title: Changing images periodically in JavaScript
body: <p>So basically I want to change image in every 5 second, so I wrote the following Javascript code and tag it to html. But the console keep saying that "No javaScript on this page" and the code does not apply </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta charset="utf-8"&gt;
          &lt;title&gt;JavaScript for Programmers&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;h2&gt;Mood Change&lt;/h2&gt;
          &lt;p&gt;The mood of this web page changes every 5 seconds.&lt;/p&gt;
          &lt;p&gt;&lt;img id="mood" src="frown.gif" alt="mood"&gt;&lt;/p&gt;
          &lt;script async src="../scripts/moody.js"&gt;&lt;/scripts&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>
  
  <pre><code>  var images=[]
    images[0]="smile.gif";
    images[1]="frown.gif";
    var myMood= document.getElementById("mood");
    function change(){
      if(myMood==images[0]){
        myMood.src=images[1];
      }
      else if(myMood.src==imgaes[1]){
        myMood.src=images[0];
      }
   }
  
   setInterval(change,5000);      
  </code></pre>