-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
73 lines (63 loc) · 2.59 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
function label_create(tagname,attrname,attrvalue,content){
var ele = document.createElement(tagname);
ele.setAttribute(attrname,attrvalue);
ele.innerHTML = content;
return ele;
}
function break_create(){
var ele = document.createElement("br");
return ele;
}
function input_create(tagname,attr1name,attr1value,attr2name,attr2value){
var ele1 = document.createElement(tagname);
ele1.setAttribute(attr1name,attr1value);
ele1.setAttribute(attr2name,attr2value);
return ele1;
}
function foo(){
{
var first = document.getElementById("firstname").value;
console.log(`FirstName:${first}`)
}
{
var middle = document.getElementById("middlename").value;
console.log(`MiddleName:${middle}`)
}
{
var last = document.getElementById("lastname").value;
console.log(`LastName:${last}`)
}
{
var email = document.getElementById("email").value;
console.log(`Email:${email}`)
}
{
var pasword = document.getElementById("password").value;
console.log(`Password:${password}`)
}
}
var first_label = label_create("label","for","firstname","Firstname");
var first_break = break_create();
var first_input = input_create("input","type","fname","name","firstname","id","firstname");
var first1_break = break_create();
var middle_label = label_create("label","for","middlename","Middlename");
var middle_break = break_create();
var middle_input = input_create("input","type","mname","name","middlename","id","middlename");
var middle1_break = break_create();
var last_label = label_create("label","for","lastname","Lastname");
var last_break = break_create();
var last_input = input_create("input","type","lname","name","lastname","id","lastname");
var last1_break = break_create();
var email = label_create("label","for","email","Email");
var email_break = break_create();
var email_input = input_create("input","type","email","id","email");
var email1_break = break_create();
var password = label_create("label","for","password","Password");
var password_break = break_create();
var password_input = input_create("input","type","password","id","password");
var password1_break = break_create();
var button = document.createElement("button");
button.setAttribute("type","button");
button.setAttribute("onclick","foo()");
button.innerHTML = "ClickMe";
document.body.append(first_label,first_break,first_input,first1_break,middle_label,middle_break,middle_input,middle1_break,last_label,last_break,last_input,last1_break,email,email_break,email_input,email1_break,password,password_break,password_input,password1_break,button);