Answers for "Code One"

0

Code One

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>Learn JavaScript</title>
    <script>
      // Code One
      document.getElementById("el").style.color = "red";
    </script>
    /* the Code One does not work because it don't 
    find which thr are loading*/
    <script>
      // Code Two
      window.onload = function () {
        document.getElementById("el").style.color = "red";
      };
    </script>
  </head>
  <body>
    <h1 id="el">Page Title</h1>
    <script>
      // Code Three
      document.getElementById("el").style.color = "red";
    </script>
  </body>
</html>
Posted by: Guest on September-26-2021

Code answers related to "Code One"

Code answers related to "Javascript"

Browse Popular Code Answers by Language