2 回答

TA貢獻(xiàn)1854條經(jīng)驗(yàn) 獲得超8個(gè)贊
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()">測(cè)試</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()">測(cè)試</button>
</body>
</html>
ab.html:
<html>
<body>
<script type="text/javascript">
function show()
{
alert(parent.document.getElementById("frame2").src);
}
</script>
<button onclick="show()">測(cè)試</button>
</body>
</html>
- 2 回答
- 0 關(guān)注
- 314 瀏覽
添加回答
舉報(bào)