车马力大小有什么关系:请问iframe 父窗体怎么改变子窗体的值呢?

来源:百度文库 编辑:神马品牌网 时间:2024/04/28 14:17:17
我根据网上的介绍,实验了这段代码,但是运行的时候,总提示找不到对象!
请高手指点!
父窗体:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>New Page 1</title>

<script type="text/javascript">
function twoframes()
{
document.myH1.innerText="hello,my dear"
}
</script>

</head>

<body>
<Iframe src="test.htm" id="test" width="250" height="200" scrolling="no" frameborder="0" ></iframe>
<input type="button" onclick="twoframes()" value="Change">
</body>

</html>

子窗体:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>New Page 1</title>
</head>

<body>
<h1 id="myH1">hello,my boy</h1>

</body>

</html>

我太菜了,请高手指点!
能说的详细点么?不 太明白!

myH1应该指定为Iframe的Id
id=myH1加入Iframe中。HTML学习指南看我的博客。网址见用户名