jQuery multiSelect 多选下拉框实现重置效果
作者:互联网
js代码
<script>
function ClearMultiSelectByName(name) {
$("input[name='" + name + "[]']").removeAttr("checked");
$("input[name='" + name + "[]']").parent().removeClass('checked');
$("a[name='" + name + "']").attr("title", "");
$("a[name='" + name + "'] span").html("== Please Select ==");
}
function ClearMultiSelect() {
//种类
ClearMultiSelectByName("Types");
$(".selectAll").removeClass("checked");
$(".selectAll input").removeAttr("checked");
}
//绑定重置按钮
$("#btnReset").click(function () {
ClearMultiSelect();
//$("#btnSearchSubmit").click();
});
</script>
html代码
<select id="Types" name="Types" multiple="multiple" class="multiselect combox text200" style="width:115px;height:30px;">
<option value="">--请选择--</option>
<option value="Type1">Type1</option>
<option value="Type2">Type2</option>
</select>
<div class="buttonContent">
<button id="btnReset" type="button">[[[重置]]]</button>
</div>
分析html结果就可以
标签:jQuery,function,checked,name,重置,html,multiSelect,input,下拉框 来源: https://www.cnblogs.com/nuomibaibai/p/16672400.html