I need to bind a click event to the elements with class '.rows', but I want to exclude one of them bearing the id '#unsigned'.
I am using ON command like this:
$('.container').on('click', '.rows', (a_function_to_run));
I was expecting this:
$('.container').on('click', '.rows',':not(#unsigned)', (a_function_to_run));
or this
$('.container').on('click', '.rows', (a_function_to_run)).not('#unsigned');
to work.
What is the right syntax? Thank you in advance for your help.
You can add :not() in the selector:
$('.container').on('click', '.rows:not(#unsigned)', function() { ... });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With