How to get all unchecked radio buttons

前端 未结 4 1059
别跟我提以往
别跟我提以往 2021-01-11 10:44

Ok, so I\'ve got a jQuery code which constructs my radio inputs from XML data, like this:

var items = xml.children(\'item\');
if (items.length > 0)
{
             


        
4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-11 11:24

    $('form input[type="radio"]').not(':checked').each(function() {
        $(this).addClass('unchecked');
        // or
        $(this).slideUp('slow');
    });
    

    Obviously the element you use is up to you but the :unchecked selector is what you're after.

提交回复
热议问题