title: How to call the javascript function of one web page from another web page using onclick attribute in html?
body: <p>I want to call the javascript function of one web page from another web page. Suppose I have a function <code>myFunction()</code> that is defined in <code>A.html</code> and I want to use it in <code>B.html</code> using <code>onclick</code> attribute. How would I call <code>myFunction()</code> using <code>onclick</code> in <code>B.html</code>, so that it could bring some change in <code>A.html</code>?     </p>
  
  <p>Here is the example...</p>
  
  <p><code>A.html</code> includes </p>
  
  <pre><code>&lt;script&gt;
  function myFunction() {
      document.getElementById("my_contents").style.display="block";
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>where <code>B.html</code> have</p>
  
  <pre><code>&lt;a href="Contents.html#entertainment" target="ccc" onclick="myFunction()"&gt;
  &lt;h4&gt;Entertainment&lt;/h4&gt;&lt;/a&gt;
  </code></pre>