Edit This Code:
<!DOCTYPE html>
<html>
<body>

<h3>A demonstration of how to access a HEADER element</h3>

<article>
  <header id="myHeader">
    <h3>Internet Explorer 9</h3>
  </header>
  <p>Windows Internet Explorer 9 (abbreviated as IE9) was released to
  the public on March 14, 2011 at 21:00 PDT.....</p>
</article>

<p>Click the button to set the color of the header element to red.</p>

<button onclick="myFunction()">Try it</button>

<script>
function myFunction() {
    var x = document.getElementById("myHeader");
    x.style.color = "red";
}
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy