可能是一个愚蠢的问题,但即时通讯真的卡住了..没有这个代码发生。这就像js没有正确连接?不知道为什么JS不会加载到html
add.js
$('select').on('change', function() {
alert(this.value);
})
HTML:
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="add.js"></script>
</head>
<select>
<option value="1">One</option>
<option value="2">Two</option>
</select>
提供完整的html。在写你的js和你加载jquery的地方很重要。 – dhilt
[jQuery获取select onChange的值的值可能重复](https://stackoverflow.com/questions/11179406/jquery-get-value-of-select-onchange) –