-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdom3.html
32 lines (28 loc) · 996 Bytes
/
dom3.html
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
<!DOCTYPE html>
<html>
<head>
<title>valueANDstyle</title>
</head>
<body>
<!-- twist karke samjhte hai -->
Name:
<input type="text" id="name" placeholder="name">
<br><br>
Mobile Number:
<input type="tel" id="tele" placeholder="number" pattern="[0-9]{10}">
<br><br>
<button id="Submit">Submit</button>
<p id="para1"></p>
<button id="button2">Style it!</button>
<script type="text/javascript">
document.getElementById("Submit").onclick = function() {
document.getElementById("para1").innerHTML = document.getElementById("name").value + " and " + document.getElementById("tele").value;
}
document.getElementById("button2").onclick = function() {
document.getElementById("para1").style.color = "black";
document.getElementById("para1").style.fontSize = "20px";
document.getElementById("para1").style.fontWeight = "bold";
}
</script>
</body>
</html>