title: how to send the parameter to the javascript function in HTML?
body: <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
  
  function changetext(mypara)
  {
      mypara.innerHTML="Ooops!";
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;script&gt;var mypara = document.getElementById("para1");&lt;/script&gt;
  &lt;h1 onclick="changetext(mypara)"&gt;Click this text to change the content of following   paragraph&lt;/h1&gt;
  &lt;p id="para1"&gt; this is a paragraph I would like to change &lt;/p&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I would like to let user to click the heading to change the content of the paragraph, but I don't know the correct way of coding that. How to send the "mypara" parameter to myFunction() in HTML?</p>