如何获得 frame 的 src 的值~~

来源:互联网 发布:java程序设计实验报告 编辑:程序博客网 时间:2024/04/29 15:50

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<frameset rows="80,*" frameborder="NO" border="0" framespacing="0">
  <frame src="1.htm" name="topFrame" scrolling="NO" noresize>
  <frame src="2.htm" name="mainFrame">
</frameset>
<noframes><body>
</body></noframes>
</html>

我想用JAVASCRIPT得到 mainFrame的SRC值"2.htm",该如何写?

<input type=button onclick="javascript:alert(parent.document.getElementById('mainFrame').src);">

原创粉丝点击