当我在Chrome中运行以下代码时,当您在文本区域中输入内容时,可以使用Ctrl+Z
撤消输入。在IE中,出于某种原因,你不能。如果我没有挂钩keyup
事件,但是如下所示连接keyup
事件,则可以。有谁知道为什么不知道我能做些什么吗?
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
jQuery(function(){
jQuery("#hoge").bind("keyup", function(){
jQuery("#fuga").append("fugaA!!");
});
});
</script>
</head>
<body>
<textarea id="hoge"></textarea>
<div id="fuga"></div>
</body>
</html>
JSBin without the event hooked up(如果没有Ctrl+Z
处理程序,您可以看到keyup
适用于IE