Use the innerHTML property to change the content of the <h1> element to "New Header". - Javascript DOM

Javascript examples for DOM:Quiz

Description

Use the innerHTML property to change the content of the <h1> element to "New Header".

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<h1 id="myHeader">Give Me a New Header</h1>

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

</body>
</html>

Related Tutorials