title: Call Javascript function from another page?
body: <p>I have two html pages first one is index.html and another one is content.html.
  content.html page contains a JavaScript function and i would like to call that function from index.html page.</p>
  
  <p>I have embedded the content.html page into index.html page.
  So please suggest me how can i call that function.
  Here is the code of both pages.
  Index.html</p>
  
  <pre><code>&lt;div id="content" class="bg-danger"&gt; 
      &lt;embed src="content.html" id="child" width="100%" height="100%" style="height: 100%"&gt;
      &lt;/embed&gt; 
  &lt;/div&gt;
  </code></pre>
  
  <p>Content.html</p>
  
  <pre><code>&lt;body&gt;
  &lt;script type="text/javascript"&gt;
  function content2(){
      alert("content");
  }
  &lt;/script&gt;
  &lt;div&gt;
      Content Page
      &lt;button  id="contentbtn" onclick="content();"&gt;Click&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>Making a external file makes its easy but condition is that the code must reside on javascript html page.</p>