我有一个MultiSelect列表框
@Html.ListBoxFor(model => model.DealerScopeDealerProvider.DealerScopeProvider, new MultiSelectList(providers, "ProviderCode", "ProviderName"), new { id = "providerfilter" })
$('#providerfilter').multiselect({
search: true,
selectAll: true,
});
以如下方式呈现 HTML :
<select id="providerfilter" multiple="multiple">
<option></option>
</select>
<div>
<a href="#" class="ms-selectall global chkimg">Select all</a>
<a href="#" class="ms-unselectall global unchkimg">Unselect all</a>
<a href="#" class="crosimg"></a>
</div>
我想知道用户是否选择了全选选项。如何使用jquery做到这一点?
答案 0 :(得分:0)
使用下面的jquery来获取天气复选框是否已选中
if ($('.ms-selectall').is(":checked"))
{
// selectall button is selected
}
else if($('.ms-unselectall ').is(":checked"))
{
// unselectall button is selected
}