Get element value inside iframe which is nested inside Frame in javascript?
问题 I main php page in which there are 2 frames. Inside the second frame there is iframe. I want to access value of element on iframe document from the 1st frame. I tried like this: var frame1 = parent.frames[1]; var frame2 = frame1.document.getElementsByTagName('iframe')[0]; var eleValue =frame2.contentWindow.document.getElementById("MyElement").value; but I am not receiving any value though it is there. var frame1 = parent.frames[1]; alert(frame1.name); var frame2 = frame1.document