Click the event in the row of the table, except for td with class = "someClass"

I want to do some operations after clicking on a line except td with class = 'someClass'

$('#mainTable tr td:not([class=someClass])').unbind().live('click',function () { //some operation }); 

what's wrong?

note : this td is not the last td in the table.

+4
source share
2 answers

Have you studied using hasClass ?

If you leave the click event binding, then when checking the td click event

 $(this).hasClass("SomeClass"); 

The article probably explains how to use it better than I could

0
source

Maybe I missed something, but I can’t just ...

 $('#mainTable tr td').not('.someClass').click(function(){ //some operation }); 
+4
source

Source: https://habr.com/ru/post/1310686/


All Articles