Friday, March 9, 2012

:unchecked Selector ( Matches all elements that are unchecked (type check box or radio). )

    // :unchecked Selector

    // Matches all elements that are unchecked (type check box or radio).

    $.extend($.expr[':'], {
        unchecked: function (obj) {
            return ((obj.type == 'checkbox' || obj.type == 'radio') && !$(obj).is(':checked'));
        }
    });

eg:

                        alert($('input:checkbox:unchecked').length);

No comments:

Post a Comment