I’ve been attempting to modify some code that I was using previously with jQuery 1.6.4 in a jsp. What the original task was to filter out all select elements from the jsp code, so I used this:
$(':input:not("select")').change(function(){
// Do something here.
...
Then I was told that some of the selects needed to be included, so I thought I’d add in a class like this:
(':input:not("select")' || $(!'.dontIgnoreSelect')).change(function(){
// Do something here.
...
but the logic is wrong here as the short circuit checks the first condition and then moves on.
I want to catch all other form elements as before, but only filter out the selects that don’t have the class assigned to them or use some similar mechanism. I opted for a class as it’s going to be used with multiple jsps.
I realized the orignal code won’t work, but how can I do this?
I’m surprised the first part of the expression works, but whatever.