Accessing an element in iframe Not working. strange

Hai folks,

my document have form to ad candiates.
the form also has an iframe, in that an HTML file upload is kept. when a user uploads a file, on success, a div is shown telling upload success.
now, when the user completed the form, i am resetting the form element. so i want to make the text in the div mentioned about to be ‘none’.

window.frames['frame_cv'].document.getElementById('res_cv_attach').innerHTML='none';
  • frame_cv’ = iframe id
  • res_cv_attach = div’s id

This does not work :rolleyes:

Hi
Try with iframe.contentWindow .
Example:

var myIFrame = document.getElementById(iframe_id);
myIFrame.contentWindow.document.getElementById('res_cv_attach').innerHTML = 'none';

Or see this tutorial: Get and modify content of an Iframe .

Thant works charm!! thanks buddy !!!