title: assigning variable to document.getElementById().Innerhtml not working
body: <p>See the code below:</p>
  
  <pre><code>var text=["yuppie", "kkkoseh", "watchdog"];
  
  var messageIndex=0;
  
  function looptext (){
      var MessageElement= document.getElementById("happy").innerHTML
      var Message=text[messageIndex];
  
      MessageElement=Message;
      messageIndex++;
  
      if(messageIndex&gt;=text.length){
          messageIndex=0;
      }
  }
  
  window.onload = function() {
      setInterval(looptext, 1000);
  };
  </code></pre>
  
  <p>It doesn't work. </p>
  
  <p>But when I remove <code>.innerhtml</code> at variable <code>MessageElement</code> and set the <code>MessageElement.innerHtml= Message</code> , it works. </p>
  
  <p>Why is it so?<br>
  Sorry, I am a newbie learning JavaScript.</p>