当我单击按钮时,我试图选择下拉菜单到特定选项
我有
HTML
<select id='selectmenu'>
<option>
1
</option>
<option>
2
</option>
<option>
3
</option>
</select>
<a id='click'>click</a>
Run Code Online (Sandbox Code Playgroud)
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....
})
Run Code Online (Sandbox Code Playgroud)
谢谢您的帮助!
| 归档时间: |
|
| 查看次数: |
45 次 |
| 最近记录: |