Use HTML DOM to change the value of the input's value attribute to "Goodbye". - Javascript DOM

Javascript examples for DOM:Quiz

Description

Use HTML DOM to change the value of the input's value attribute to "Goodbye".

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<input type="text" id="myText" value="Hello">

<script>
document.getElementById("myText").value = "Goodbye";
</script>//from   w w w . j ava  2  s .c o  m

</body>
</html>

Related Tutorials