I have this jQuery function:
$(this).change(function(){
alert('I changed. ID: ' + $(this).attr("id"));
});
I need the alert to fire except when the id name ends in -0. I think I should be using the $= operator. I cannot figure out how to make it work.
Your selector should use
:not()combined with attribute-ends-with ($=) look like this:It’s better to have something in front of that so it doesn’t run against every element, a class or an element tag, etc, like this: