当我点击按钮
时,我试图选择某个选项的下拉菜单我有
HTML
<select id='selectmenu'>
<option>
1
</option>
<option>
2
</option>
<option>
3
</option>
</select>
<a id='click'>click</a>
Jquery
$('#click').click(function(){
var option=3;
//I want the select dropdown menu to select option 3 when I click the button.
//$('#selectmenu').select() //I think it will be something like this....
})
感谢您的帮助!
答案 0 :(得分:5)
$('#selectmenu').val(3); //p00f!