如何捕捉< select>变化的事件用jQuery? [英] How to catch the event of change of <select > with jQuery?
本文介绍了如何捕捉< select>变化的事件用jQuery?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<select id="target">
<option value="1">item1</option>
<option value="2">item2</option>
<option value="3">item3</option>
</select>
说,我想根据选择的值进行一些处理.
Say,I want to do some processing according to selected value.
推荐答案
$('#target').change( function() {
$(this).find(":selected").each(function () {
console.log( $(this).val() );
});
});
这篇关于如何捕捉< select>变化的事件用jQuery?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文