priyank priyank - 1 year ago 66
jQuery Question

Selector for element inside a frame (with same origin)

I have a webpage with the following structure:

<frame name="frame1" src="/index.jsp"/>
<frame name="frame2" src="/blank.jsp"/>


... <div id="test">test is here</div> ...

I need a jQuery selector to directly access
. So far I've only been able to write it like this:
...or this:
. But I have a template which requires me to write my selector inside
$("here only")
. So I can't use
or other functions.

Answer Source


$("div#test", $("#someIFrame").contents())
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download