Deselect an ID that would otherwise be selected by

2019-08-19 23:13发布

I have a page where all inputs are assigned a behavior: $("input").blur(function () {

and I need to exclude a checkbox that has a specific id:

  <input type="checkbox" id="allButMe" onchange="billingSameChanged();" value="true"/> 

thx

2条回答
该账号已被封号
2楼-- · 2019-08-19 23:47

use jQuery not here

$("input").not("#allButMe").blur(function() {});
查看更多
你好瞎i
3楼-- · 2019-08-19 23:50

Use jQuery's not selector like this:

$("input:not(#allButMe)").blur(function() { });
查看更多
登录 后发表回答