tags:

views:

348

answers:

2

I have a page called loader.html. It contains an iframe, which contains jQuery.

On index.html, I do <iframe src="loader.html">

How do I access the elements inside loader.html ? top.document ?

+2  A: 

Use the contents() method:

$('iframe').contents().find('body');
brianpeiris
A: 

How would you do the opposite?

Have the iframe loader.html and want to access the parent information?

<html>
<head>
<title>I Dont know</title>
</head>
<body id="myParentBody">

<iframe id="myLoaderIframe" src="loader.html">

</body>
</html>

How can i access the body myParentBody from the loader.html to lets say change the background color or image of id:myParentBody??

Jeremy