iframe中的页面内元素如何访问?

[复制链接]
查看11 | 回复1 | 2012-3-4 10:36:11 | 显示全部楼层 |阅读模式
页面如下:
1.asp



2.asp



不管我怎么用:
window.edit.document.getElementById("input1").value
window.edit.document.all.input1.value
window.frames("edit").document.input1.value
window.frames["edit"].document.input1.value
document.frames["edit"].document.input1.value
document.frames("edit").document.input1.value
document.frames("edit").document.all.input1.value
document.all.edit.document.all.input1.value
....
没有一句能访问到2.asp页面中input1元素的value值,谁能告诉我怎么得到这个值?谢谢各位大侠了!还是根本就没这种事情的?

回复

使用道具 举报

千问 | 2012-3-4 10:36:11 | 显示全部楼层
var obj=window.contentWindow.document.getElementById('input1');alert( obj.value );
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行