<!DOCTYPE html>
<html>
<body style="text-align:center;">
<h1 style="color:green;">
MLC Computer Korba
</h1>
<h2>Text value property</h2>
<p>
Change the text of the text field,
and then click the button below.
</p>
Name:<input type="text" id="myText" value="Student">
<button type="button" onclick="myFunction()">
Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myText").value;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
No comments:
Post a Comment