checkbox 全选或取消

Html: 点击label 也能 checkthis

                   <div class="checkbox">
                        <input class="inputCheckbox" id="brandCheck_17" type="checkbox" value="">
                        <label for="brandCheck_17">Lenovo</label>
                    </div>spa

JQ:对象

        $(".CleanAll").on("click", function ()
        {
            $("input[id^='brandCheck_']").prop("checked", false);blog

            $("a[id^='btnApply_']").attr("style", "display:none;");
           
        });input

效果图:string

其余方法:io

 $("input[type='checkbox']").attr("checked",false);  只能取消初始已经 checked  的对象,不能全消后来checked.function

  $(this).prop("checked", false); 能够 实现全选 或 取消class

相关文章
相关标签/搜索