2 回答
TA贡献1854条经验 获得超8个赞
a.html:
<html>
<body>
<script type="text/javascript">
function show()
{
alert(document.getElementById("frame2").src);
}
</script>
<iframe name="frame2" id="frame2" src="ab.html"></iframe>
<iframe name="frame3" id="frame3" src="axx.html"></iframe>
<button onclick="show()">测试</button>
</body>
</html>
<html>
<body>
<script type="text/javascript">
function show(){ alert(document.getElementById("frame2").src);}
</script>
<iframe name="frame2" id="frame2" src="ab.html"></iframe>
<iframe name="frame3" id="frame3" src="axx.html"></iframe>
<button onclick="show()">测试</button>
</body>
</html>
ab.html:
<html>
<body>
<script type="text/javascript">
function show()
{
alert(parent.document.getElementById("frame2").src);
}
</script>
<button onclick="show()">测试</button>
</body>
</html>
- 2 回答
- 0 关注
- 288 浏览
添加回答
举报