Use the getElementById method to find the <p> element, and change its text to "yes". - Javascript DOM

Javascript examples for DOM:Quiz

Description

Use the getElementById method to find the <p> element, and change its text to "yes".

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="demo">Use the DOM to change my text!</p>

<script>
document.getElementById("demo").innerHTML = "yes";
</script>/*from w w w  .  j a v a2 s .c o  m*/

</body>
</html>

Related Tutorials