Questions tagged «bootstrap-select»

18
如何使用引导程序中的selectpicker插件在select上设置选定值
我正在使用Bootstrap-Select插件,如下所示: HTML: <select name="selValue" class="selectpicker"> <option value="1">Val 1</option> <option value="2">Val 2</option> <option value="3">Val 3</option> <option value="4">Val 4</option> </select> Javascript: $('select[name=selValue]').selectpicker(); 现在,我想在单击按钮时将选择的值设置为此选择……类似这样: $('#mybutton').click(function(){ $('select[name=selValue]').val(1); }); 但是什么也没发生。 我该如何实现?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.