如何编写jquery
DropDown列表选择索引更改事件如何工作jquery?
答案 0 :(得分:3)
您可以使用以下代码:
<select id="selDiv" name="selDiv">
<option>111</option>
<option>222</option>
<option>333</option>
</select>
$('#selDiv').change(function(){
/// you can write you code what you want to do...
});
答案 1 :(得分:2)
<select class="target">
<option value="option1" selected="selected">Option 1</option>
<option value="option2">Option 2</option>
</select>
$(document).ready(function(){
$('.target').change(function() {
alert('Dropdown Changed');
});
});
<强> Further Reference 强>