jQuery - Multiple Selectors in a :not()?

后端 未结 3 948
攒了一身酷
攒了一身酷 2021-02-03 17:58

I cant seem to get the following working:

$(\'input:not([type=radio][type=checkbox])\').live(\'click\', function() {
    alert(\"You haven\'t clicked a radio or          


        
3条回答
  •  南方客
    南方客 (楼主)
    2021-02-03 18:15

    You can also exclude items like this:

    $('input').not('[type=radio], [type=checkbox]').live('click', function() {
        alert("You haven't clicked a radio or checkbox!");
    });
    

提交回复
热议问题