-
Notifications
You must be signed in to change notification settings - Fork 0
/
script1.js
110 lines (82 loc) · 3.32 KB
/
script1.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// function call(){
// const result=document.getElementById("email").value;
// if(result===b50wd2tamil@gmail.com)
// {
// console.log("valid");
// }
// else
// {
// console.log("invalid");
// }
// }
// function createLabel(tagname,content,attrname,attrvalue)
// {
// var label=document.createElement(tagname)
// label.innerHTML= content;
// label.setAttribute(attrname,attrvalue)
// return label;
// }
// const label1=createLabel("label","Firstname","for","firstname")
// function calculateAge(){
// const dob= new Date(document.getElementById("dob").value);
// const today= new Date();
// if(isNaN(dob.getTime())){
// var error= document.getElementById("output").innerHTML="Please enter the valid dob";
// return error;
// }
// let age= today.getFullYear()-dob.getFullYear();
// const monthdiff= today.getMonth()- dob.getMonth();
// document.getElementById("output").innerHTML="You are"+" "+ age +"years old";
// }
// function createLabel(tagname,content,attrname,attrvalue){
// const label=document.createElement(tagname);
// label.innerHTML= content;
// label.setAttribute(attrname,attrvalue);
// return label;
// }
// var linebreak= document.createElement("br");
// function createinput(tagname,content,attrname,attrvalue){
// const label2=document.createElement(tagname);
// label2.innerHTML= content;
// label2.setAttribute(attrname,attrvalue);
// return label2;
// }
// const form= document.createElement("form")
// const label4=createLabel("label","FirstName","for","FirstName");
// const label5=createinput("input","text","type","text");
// form.append(label4,label5);
// const label6=createLabel("label","LastName","for","LastName");
// const label7=createinput("input","text","type","text");
// form.append(label6,label7);
// const label8=createLabel("label","PhoneNumber","for","PhoneNumber");
// const label9=createinput("input","number","type","number");
// form.append(label8,label9);
// const label1=createLabel("label","Email","for","Email");
// const label3=createinput("input","text","type","text");
// form.append(label1,label3);
// document.body.append(form);
// function createLabel(tagname, content, attrname, attrvalue) {
// const label = document.createElement(tagname);
// label.innerHTML = content;
// label.setAttribute(attrname, attrvalue);
// return label;
// }
// function createInput(tagname, attrname, attrvalue) {
// const input = document.createElement(tagname);
// input.setAttribute(attrname, attrvalue);
// return input;
// }
// const form = document.createElement("form");
// const label4 = createLabel("label", "First Name", "for", "FirstName");
// const input4 = createInput("input", "type", "text");
// form.append(label4, input4);
// const label6 = createLabel("label", "Last Name", "for", "LastName");
// const input6 = createInput("input", "type", "text");
// form.append(label6, input6);
// const label8 = createLabel("label", "Phone Number", "for", "PhoneNumber");
// const input8 = createInput("input", "type", "number");
// form.append(label8, input8);
// const label1 = createLabel("label", "Email", "for", "Email");
// const input1 = createInput("input", "type", "text");
// form.append(label1, input1);
// document.body.append(form);