我在div中有一个选择框,默认情况下不显示,在某些点击事件上,div的显示属性更改为阻止,但是选择下拉列表不显示,并显示空格.我在同一个触发函数中为选择框调用了selected()方法,我正在更改div的可见性.
这是我的问题的代码.
<div class="controls" style="display:none" id="Department-11"> <select multiple="" class="chosen-select1" id="form-field-select-4" data-placeholder="Choose a Department..."> <option value="Management">Senior Management</option> <option value="Legal">Legal</option> <option value="Operations">Operations</option> <option value="Administration">Administration</option> <option value="R&D">R&D</option> <option value="Sales & Marketing">Sales & Marketing</option> <option value="Finance">Finance</option> <option value="Technology">Technology</option> <option value="Customer Service">Customer Service</option> <option value="Pro Services">Pro Services</option> <option value="HR">HR</option> <option value=""></option> </select> </div> <a href="javascript:void(0);" onclick="showselect();"> Show select </a>
而JS代码是
function showselect() { $('#Department-11').show(); $(".chosen-select1").chosen(); }