title: jQuery how to select iframe?
body: <p>I'm trying to select the closest iframe with jQuery. There are a lot of these windows so, I'd like to select the nearest iframe. I'd expect closest() to work, but no luck.</p>
  
  <p>JavaScript:</p>
  
  <pre><code>$(document).ready(function(){
     var d = $(document);
     d.on('click', 'a.load_url', function() {
        var myFrame = $(this).closest("iframe").attr("class");
        alert("myFrame: " + myFrame);
     });
  });
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div id="window2"&gt;
     &lt;div class="navbar_top"&gt; 
        &lt;span class="float_left"&gt;
           &lt;a href="#" class="load_url"&gt;Click Here&lt;/a&gt;
        &lt;/span&gt;
     &lt;/div&gt;
     &lt;div class="window_content" style="border: solid 2px blue; overflow:hidden;"&gt;
        &lt;iframe class="classy_iframe" src="http://mx7racing.com"&gt; &lt;/iframe&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>