Skip to content

Commit

Permalink
🎨 Style and value
Browse files Browse the repository at this point in the history
  • Loading branch information
404reese committed Sep 26, 2024
1 parent 8046994 commit 1319041
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions DOM/dom3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,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>

0 comments on commit 1319041

Please sign in to comment.