jQuery - How to select all checkboxes EXCEPT a specific one?

前端 未结 4 2086
余生分开走
余生分开走 2021-01-05 12:42

I have a jQuery selector that looks like this ...

$(\"input:checkbox\").click(function(event) {
  // DO STUFF HERE
}

Everything was working

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-05 12:55

    $('input:checkbox:not("#thatCheckboxId")').click(function(event) {
      // DO STUFF HERE
    }
    

    Just give the checkbox in question a unique id=""

提交回复
热议问题