网站首页文章详情
jquery-select全选、反选、全不选
发布时间:2015-01-23 16:11编辑:胜男
在网上找到的jquery的select全选、反选、全不选
$("#selectAll").click(function () {//全选 $("#playList :checkbox").attr("checked", true); }); $("#unSelect").click(function () {//全不选 $("#playList :checkbox").attr("checked", false); }); $("#reverse").click(function () {//反选 $("#playList :checkbox").each(function () { $(this).attr("checked", !$(this).attr("checked")); }); });