Jquery Selectors And Condition
jquery
Solution
I think you want to use not.
This should do it:
$('input[type=image]').not(".xyz").click(function(){//something});
You may also be able to use the not selector.
$('input[type=image]:not(.xyz)').click(function(){//something});
The function version seems more expressive to me.
Problem
We have a requirement in application that on clicking on all images which do not have a css class of "xyz" we want to call a function. We are trying to write it somehwhat like this: ``` $('input[type=image] class=xyz').click(function(){//something}); ``` It doesn't seem to work. Ideal scenario would be that all images on clicking does some functionality except the one which has CSS as "xyz". What am I doing wrong? I am using input, as I use JSF and this command button is being displayed as an input type component with src as image. Thanks for your help in advance. Cheers