title: How to make a link change the content of a paragraph on click? return false not working
body: <p>I am learning to code javascripts. In this script, I want a link to not go to its specified location, but to change the text in the paragraph before it. I have created a function to achieve it onclick, but the function is not able to return false.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Javascript Test #6&lt;/title&gt;
      &lt;script type="text/javascript"&gt;
          document.getElementById("links").onclick=writeData();
          function writeData()
              {
                  document.getElementById("para").innerHTML="Changed Paragraph Content";
                  return false;
              }
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;p id="para"&gt;Unchanged Paragraph Content&lt;/p&gt;
      &lt;br/&gt;
      &lt;a id="links" href="javascript-return.html"&gt; Click here to change the paragraph content &lt;/a&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>