index.html:
<html>
<body>
<div>
<iframe id="a" stc=a.html>
</iframe>
</div>
</body>
</html>
a.html:
<html>
<frameset>
<frame src="aa.html" id="aa">
<frame src="bb.html" id="bb">
</frameset>
</html>aa.html:
<html>
<body>
<div>
<input id="aaa" name="aaa" value="" type="text">
</div>
</body>
</html>
要求在index.html页面用JS实现 获取到aa.html中input项的value值。
<html>
<body>
<div>
<iframe id="a" stc=a.html>
</iframe>
</div>
</body>
</html>
a.html:
<html>
<frameset>
<frame src="aa.html" id="aa">
<frame src="bb.html" id="bb">
</frameset>
</html>aa.html:
<html>
<body>
<div>
<input id="aaa" name="aaa" value="" type="text">
</div>
</body>
</html>
要求在index.html页面用JS实现 获取到aa.html中input项的value值。
不行吗?
if(document.getElementById("a").contentWindow.document.getElementById("aa") == null){
o = setTimeout("test()", 1000);
}else{
clearTimeout(o);
document.getElementById("a").contentWindow.document.getElementById("aa").contentWindow.document.getElementById("aaa").value = 123;
}
}
test();
通过document.getElementById("a").contentWindow.document.getElementById("aa").contentWindow.document.getElementById("aaa").value这种方式已经解决....谢谢