<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<select id="select-some" onchange="alert(this.value)">
<option>sdfsd</option>
<option>ssdfsdfd</option>
<option>sdsdfsdfsfdsd</option>
</select>
<script>
var selectSome = document.getElementById("select-some");
selectSome.addEventListener("onchange", function () {
alert(this.value);
}, false);
</script>
</body>
</html>
为什么下面的js脚本没反应,而<select id="select-some" onchange="alert(this.value)">
可以正常执行。
呼如林
相关分类