<!DOCTYPE html>
<html lang="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<head>
<title>Select 选择相同项触发Change事件</title>
</head>
<body>
<select id="myID">
<option>xxxxxxxx1</option>
<option>xxxxxxxx2</option>
<option>xxxxxxxx3</option>
</select>
</body>
</html>
<script type="text/javascript">
<!--
var id = document.getElementById("myID");
id.onclick = function () {//当按下鼠标按钮的时候
if (!this.bypass || this.bypass == "0") {
this.bypass = "1";
}
else {
alert(this.value);
this.bypass = "0";
}
}
id.onblur = function () {//失去焦点时
this.bypass = "0";
}
//-->
</script>