jquery的判断checkbox有没被选中
2012-1-30 18:35 Monday  

分类: Javascript 评论(2) 浏览(66656)

function checkSelect() {

var flag = 0;

$("input[name='edit[]']:checkbox").each(function () {

    if ($(this).attr("checked")) {

        flag += 1;

    }

})

if (flag > 0)

return true;

else{

alert('没有选中一个');

return false;

}

}

+1 15

留下你的看法: