问题
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
回答1:
Use jQuery's not selector like this:
$("input:not(#allButMe)").blur(function() { });
回答2:
use jQuery not here
$("input").not("#allButMe").blur(function() {});
来源:https://stackoverflow.com/questions/2710400/deselect-an-id-that-would-otherwise-be-selected-by-class