document.onpaste 为什么在IE6下没用

来源:百度知道 编辑:UC知道 时间:2024/09/18 06:52:37
document.onpaste = function(){
alert("粘贴");
};

我是这样写的。在FF下没问题。。

但在IE6下不执行。 有人知道为什么吗?或者能提供什么其他的方法代替吗?
我需要的是 document的onpaste 事件。 不是某个元素的onpaste 事件

而且 iframe下的页面document的onpaste 也不行。

你要用语句判断浏览器类型,如果是IE,直接写onpaste就行了
<input name="mobileNo1" class="width150px" tabindex="2" type="text" maxlength="11" value="" onpaste="return false;"/>