【发布时间】:2013-02-11 09:05:40
【问题描述】:
我想向iframe 添加点击事件。我用this example 得到了这个:
$(document).ready(function () {
$('#left').bind('click', function(event) { alert('test'); });
});
<iframe src="left.html" id="left">
</iframe>
但不幸的是,什么也没发生。
当我用另一个元素(例如按钮)对其进行测试时,它可以工作:
<input type="button" id="left" value="test">
【问题讨论】:
-
你为什么不把它添加到left.html?
-
我的页面上有几个 iframe。我希望该上下文菜单可以在它们之上展开。
标签: javascript jquery iframe