`
conkeyn
  • 浏览: 1504428 次
  • 性别: Icon_minigender_1
  • 来自: 厦门
社区版块
存档分类
最新评论

解决IE7 IE8的input不触发onchange事件

    博客分类:
  • HTML
阅读更多
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery.min.js"></script>
</head>
<body>
<input type="text" id="input1" >
<div id="output" ></div>
<script type="text/javascript">
$('#input1').click(function () {
    // Cause the change() event
    // to be fired in IE8 et. al.
    this.blur();
    this.focus();
});
$('#input1').change(function() {
	change();
});
function change(){
	$("#output").html($("#input1").val());
}
</script>
</body>
</html>

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics