Sunday, August 5, 2012

How to access page elements from Iframe using JavaScript

Let say we have span element on my parent page with label id " spanTitlePersonalInfo"

We can simply access by 

window.top.document.getElementById('spanTitlePersonalInfo') 

or if you want to make hide, show you can do like this.

window.top.document.getElementById('spanTitlePersonalInfo').style.display = 'none';
window.top.document.getElementById('spanTitleCheckOut').style.display = 'block';


--
Shahzad Afzal
http://www.pakistanprobe.com/



No comments:

Popular Posts