title: How to target parent ID outside an iframe jQuery
body: <p>How do I target <code>#main</code> from a button within an iframe using jQuery?</p>
  
  <pre><code>&lt;div id="main"&gt;
  
  &lt;iframe&gt;&lt;a class="click" href="#"&gt;a button inside a separate HTML&lt;/a&gt;&lt;/iframe&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>I have this code:</p>
  
  <pre><code>$('.class').on('click', function(){
      $('#main', parent.document).animate({ 
              'bottom' : '0'
              });
  });
  </code></pre>
  
  <p>What I wanted to do is when user clicks the button within the iframe(from a separate HTML document), it targets the <code>#main</code> then it will animate.</p>