How to access iframe in jQuery

Assuming you have

1
  <iframe id="iframeID" ...></iframe>

Iframe contains div with id=”someID”:

1
  <div id="someID">Hello world!</div>

Need get div’s text?

1
  $('#iframeID').contents().find('#someID').html();

This entry was posted on Friday, March 21st, 2008 at 21:45 and is filed under jQuery. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.





Leave a Reply


required


required (will not be published)