The all-around way to getting a frame's contents is with something like this:
var theFrame = document.getElementsByTagName("frame")[0];
var theFrameDocument = theFrame.contentDocument || theFrame.contentWindow.document;
var button = theFrameDocument.getElementById("mybutton");
However, it is possible to get a <frame>
's document by using its name, like:
window.frames["frame_name"].document
if the HTML were:
<frame name="frame_name">...</frame>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…