Can you change innerHTML of IFRAME?
IFRAME tag in HTML doesn't has innerHTML attribute/property which could have been used to change the content of IFRAME without changing "SRC".
If your IFrame is defined like : <iframe name='myIFRAME' > </iframe>
In your javascript function you can change innerHTML of IFRAME using:
document.myIFRAME.document.body.innerHTML = 'yourHTML';
similarly you can change innerHTML of components inside the IFRAME:
document.myIFRAME.document.getElementById('your_element_id').innerHTML = 'yourHTML';
If your IFrame is defined like : <iframe name='myIFRAME' > </iframe>
In your javascript function you can change innerHTML of IFRAME using:
document.myIFRAME.document.body.innerHTML = 'yourHTML';
similarly you can change innerHTML of components inside the IFRAME:
document.myIFRAME.document.getElementById('your_element_id').innerHTML = 'yourHTML';
Labels: html, IFRAME, innerHTML, src
1 Comments:
Thank you. So simple. I've been looking for this for a long time !!
By bernard Ho-Jim, at May 16, 2012 10:37 AM
Post a Comment
<< Home