web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Nishant Rana’s Weblog / Accessing IFrame through Ja...

Accessing IFrame through JavaScript

Nishant Rana Profile Picture Nishant Rana 11,325 Microsoft Employee

Accessing IFrame through JavaScript

window.frames[0].location

window.frames[“myframename”].location // through name

document.getElementById(‘myframeid’).src // through id

Accessing a div element name myDiv within Iframe

window.frames[“myframename”].document.getElementById(‘myDiv’).innerHTML

document.getElementById(‘myframeid’).contentDocument.getElementById(‘myDiv’).innerHTML

Accessing a div element name myDivInside within Iframe(myfframeid) which itself is inside an Iframe(myframeid)

document.getElementById(‘myframeid’).contentDocument.getElementById(‘myfframeid’).contentWindow.document.getElementById(‘myDivInside’).innerHTML

http://www.dyn-web.com/tutorials/iframes/

Bye.


Filed under: Microsoft Dynamics CRM

This was originally posted here.

Comments

*This post is locked for comments