I have a webpage with the following structure:
<html>
<head>...</head>
<frameset>
<frame name="frame1" src="/index.jsp"/>
<frame name="frame2" src="/blank.jsp"/>
</frameset>
</html>
index.jsp
contains:
<html>
<head>...</head>
<body>
... <div id="test">test is here</div> ...
</body>
</html>
I need a jQuery selector to directly access div#test
. So far I've only been able to write it like this: $(frames[0].document.body)
...or this: $("frame[name='frame1']")
. But I have a template which requires me to write my selector inside $("here only")
. So I can't use .find()
or other functions.
Try:
$("div#test", $("#someIFrame").contents())
yeah I got it. thanks.
This is what I wrote.
$("div[id='test'] > span",frames['frame1'].document).text()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With