title: changing color using javascript
body: <p>i am a beginner to java script.i do the bellow code for changing the text color into red using java script.But it doesn't work.what is the error in my code?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
  function display()
  {
  var col=document.getElementById("demo").innerHTML;
  col.style.color="red";
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;h1&gt;My First JavaScript&lt;/h1&gt;
  &lt;p id="demo"&gt;click on the button bellow.....&lt;/p&gt;
  
  &lt;button onclick="display()"&gt;Display&lt;/button&gt;
  
  &lt;/body&gt;
  &lt;/html&gt; 
  </code></pre>