jQuery checkbox按钮选择

$(function() {
    $(":checkbox").each(function() {
        $(this).click(function() {
            if ($(this).attr("checked")) {
                $(this).attr("value", "true");
            } else {
                $(this).attr("value", "false");
            }
        });
    });
});

 

posted @ 2015-04-13 12:19  √珞珈搬砖工√  阅读(117)  评论(0)    收藏  举报