---
title: "解决IE7 IE8的input不触发onchange事件"
author: "conkeyn"
date: "2018-10-22T10:49:20Z"
tags: []
categories: ["互联网"]
slug: "ie7-ie8-input-onchange"
draft: false
lastmod: "2018-10-22T10:49:20Z"
id: 2432531
url: "https://conkeyn.iteye.com/blog/2432531"
---

```
<!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>
```