title: How to access a function or variable from the parent iframe in jquery
body: <p>i have two iframes one is parent another one is child and on button click in child iframe i need to access the function or variable from the parent iframe.</p>
  <p>Parent iframe:</p>
  <pre><code>&lt;iframe id=&quot;parentiframe&quot; scrolling=&quot;true&quot; src=&quot;#&quot;&gt;&lt;/iframe&gt;
  </code></pre>
  <p>parent function:</p>
  <pre><code>function iframe1function() { //$('#SUBFORAPPRL span').click();
  
      $(&quot;[id='field_Update Status'] span&quot;).click();
      $('.quote-title-span8').text('Approved');
      $('#approval_act_btn').hide();
    
  }
  </code></pre>
  <p>Child iframe:</p>
  <pre><code>&lt;iframe src=&quot;../../quotation/Approvals.aspx&quot; loading=&quot;lazy&quot; height=&quot;600&quot; width=&quot;100%&quot; id=&quot;childIframe&quot; title=&quot;Approve Iframe&quot;&gt;&lt;/iframe&gt;
  </code></pre>
  <p>child button:</p>
  <pre><code>&lt;button type=&quot;button&quot; id=&quot;act_btn&quot; class=&quot;art10&quot; onclick=&quot;iframe1function()&quot;&gt;button&lt;/button&gt;
  </code></pre>