Jump to content

  • Free consultations and support
  • Live chatClick Here for Live Chat
  • Call ico 1888-906-1888
    Phone support: Open

    Ready for your call :)

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams

    Phone support: Closed

    We are back in: 1h 20m

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams


How to Access iFrame Elements in jQuery

access iframe elements jquery

  • Please log in to reply
 

#1 SmartWeb

SmartWeb

    Senior Member

  • Designer
  • 271 posts

Posted 16 August 2012 - 10:09 AM

Knowing how to access elements inside access iFrame with Javascript could be very handy . jQuery’s contents() method is used to do this. This method enables us to load iframe’s DOM in a single line.

$(function(){

var iFrameDOM = $("iframe#ID").contents();

// you can use the <strong>find()</strong> to access
elements in the iframe:

iFrameDOM.find(".msg").slideUp();

//this will slide up all the elements classed 'msg' in the iframe

});





Also tagged with one or more of these keywords: access, iframe elements, jquery

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users