-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path25-accesing_the_element.html
More file actions
51 lines (31 loc) · 1.02 KB
/
Copy path25-accesing_the_element.html
File metadata and controls
51 lines (31 loc) · 1.02 KB
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
<!doctype>
<html>
<head>
<meta name= "accessing the element" content ="">
<meta charset = "utf-8">
<title>accessing the element</title>
<script>
function checkd()
{
var inputs = document.getElementByTagName("input");
var message = "your form \n\n";
for(var i = 0 ; i < inputs.length ; i++)
{
if(inputs[i].getAttribute('type') == 'text')
{
message = message + inputs[i].getAttribute('name') + ": ";
message = message + inputs[i].value + "\n";
}
}
alert(message);
}
</script>
</head>
<body>
<form id = "userform" action = "#" >
<input type = "text" name = "name" id = "txt_name"/>
<input type = "text" name = "email" id = "txt_email"/>
<input type = "button" name = "submit" value ="Submit" onclick ="checkd();"/>
</form>
</body>
</html>