0

Suppose we have the following structure :

  <div id='main'>
   <div id="1"> .. </div>
   <div id="2">
     <iframe id="ifr" src="some"></iframe>
   </div>
  </div>

How can we access div#1 contents from inside the iframe#ifr?

Gaurav
  • 8,367
  • 14
  • 55
  • 90
  • 4
    You should [try the search once in a while](http://stackoverflow.com/search?q=access+iframe) – Joseph May 27 '12 at 12:45
  • 1
    Here is the answer for your question: http://stackoverflow.com/questions/726816/how-to-write-this-in-jquery-window-parent-document-getelementbyidparentprice. – VisioN May 27 '12 at 12:47

1 Answers1

1

use this :)

window.parent.document.getElementById('1')
Marwan
  • 2,362
  • 1
  • 20
  • 35