点击“赋值”后,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 name='dbs' id='dbs' type="text" value="3333" />
</BODY>
</HTML>
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |