1

HTML File--

<!doctype html>
<html lang="en">
 <head>
    <meta charset="utf-8">
     <title>Movies</title>
     <script src="practise.js"></script>
 </head>
 <body>
     <h1>Movie Showtimes</h1>

     <h2 id="movie1">Plan 9 from Outer Space</h2>

     <p>Playing at 3:00pm, 7:00pm.
         <span>
         Special showing tonight at <em>midnight</em>!
         </span>
     </p>
     <h2 id="movie2">Forbidden Planet</h2>

     <p>Playing at 5:00pm, 9:00pm.</p>
 </body>
</html>

JavaScript File--

  var planet = document.getElementById("movie2");
  planet.innerHTML = "Red Alert: hit by phaser fire!";

Where's the problem?? It show's Uncaught TypeError: Cannot set property 'innerHTML' of null. Can anyone plz tell me where's the problem??

0 Answers0