我该如何做,当我选择一个选项后,我会点击按钮后会做些什么?
jquery select on click
这是我到目前为止有:
<select id="colors">
<option value="">Select Color</option>
<option value="red">red</option>
<option value="blue">blue</option>
<option value="green">green</option>
</select>
<button>GO</button>
的jQuery:
$(function(){
$('#colors').change(function(){
if (this.value === 'red') {
console.log('red selected');
}
});
});
您可以点击事件添加到'go'按钮http://jsfiddle.net/1dwboe6w/2/ –