点击“赋值”后,bottom页面的input值变为2,如何实现?
主页:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> frameDemo </TITLE>
</HEAD>
<frameset rows="50%,50%">
<frame id=top name=top src="top.html">
<frame id=bottom name=bottom src="bottom.html">
</frameset>
</HTML>
top.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
</HEAD>
<BODY>
<SCRIPT>
function fu(){
var btm = top.document.getElementById('bottom').contentWindow
btm.document.getElementById("dbs").value = 2;
}
</SCRIPT>
<input value="赋值" onclick="fu();" type="button" />
</BODY>
</HTML>
bottom.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
</HEAD>
<BODY">
<h1>This is the content in button.html.</h1>
<input type="text" value="3333" />
</BODY>
</HTML>