请问frame如何操作父窗口元素?谢谢! alert(parent.document.all.url.value); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 alert(parent.url.value);因为不是包含在form里面的,直接操作就行了如果在form里面,写成alert(parent.form.url.value); alert(window.top.document.all("url").value); alert(parent.document.getElementById('url').value); parent.document.getElementById('url').value或者parent.document.url.value应该都可以的。 <HTML><HEAD><TITLE></TITLE><script language="javascript">function test(){alert(document.all.url.value);}</script></HEAD><body><Input name="url" type=text id="url" size=30 value="123"><a href="#" onclick="test();">test</a><br /><iframe id="fra1" src="test2.htm"></body></HTML>test2.htm<HTML><HEAD><TITLE></TITLE><script language="javascript">function test(){alert(parent.document.all.url.value);}</script></HEAD><body><a href="#" onclick="test();">test</a></body></HTML> 求高手,本人jquery欠缺 请进来看下这种效果如何实现 谢啊 关于使用window.open的问题 关于checkbox全选的问题 真是很头疼,达人请进。。。。。 如何按中键不出现那个上下的轱辘? 求JavaScript使用手册 js 能否设置 多个 cookie值? 求一个页面滚动条的样式 在JAVASCRIPT中,怎样判断是按下了键盘上的哪个键如:回车键,方向键,,,等等? 这段代码哪里错了???急! svg问题!高手请指教! web页面test.asp中插入一个<iframe src='test1.asp'>,如何在在test1.asp刷新test.asp页面
如果在form里面,写成alert(parent.form.url.value);
或者parent.document.url.value应该都可以的。
<HEAD>
<TITLE></TITLE>
<script language="javascript">
function test()
{
alert(document.all.url.value);
}
</script>
</HEAD>
<body>
<Input name="url" type=text id="url" size=30 value="123">
<a href="#" onclick="test();">test</a>
<br />
<iframe id="fra1" src="test2.htm"></body>
</HTML>test2.htm<HTML>
<HEAD>
<TITLE></TITLE>
<script language="javascript">
function test()
{
alert(parent.document.all.url.value);
}
</script>
</HEAD>
<body>
<a href="#" onclick="test();">test</a>
</body>
</HTML>