<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> <script src="chosen/chosen.jquery.js" type="text/javascript"></script>
应用JS文件
<select class="chzn-select" data-placeholder="Choose a Country" style="350px;" tabindex="1"> <option value=""></option> <option value="United States">United States</option> <option value="United Kingdom">United Kingdom</option> <option value="Afghanistan">Afghanistan</option> <option value="Albania">Albania</option> </select>
class设这为chzn-select
初始化:$(".chzn-select").chosen();
对select进行操作时候需注意如下:先删除外部套用的层在经常操作,最后在加上$(".chzn-select").chosen();
var selectObj = $("#slectplat");
selectObj.parent().children().remove('div');
selectObj.removeClass();
$("#slectplat").val(_plat);
selectObj.addClass("chzn-select");
selectObj.chosen();