【发布时间】:2010-11-04 14:50:02
【问题描述】:
我正在尝试用 jquery 做一些事情。
我有这样的代码 1.html;
<html>
<head>
<script language="javascript" type="text/javascript" src="jquery.js"></script>
</head>
<body>
<iframe src="2.html" id="frame1"></iframe>
<iframe src="3.html" id="frame2"></iframe>
</body>
</html>
在 2.html 文件中。我正在尝试访问 iframe 容器 ID。 2.html文件内容;
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function (){
$('#btnIdKim').click(function (){
});
});
</script>
</head>
<body>
<input type="button" name="btnIdKim" id="btnIdKim" value="Id Kim" />
</body>
</html>
当用户点击 btnIdKim 按钮时。我需要通过按钮访问包含的父 iframe id。
但我不知道怎么做。
感谢每一位感兴趣的人。
【问题讨论】: