How can i ignore a click on a selected column
How can i ignore a click on a selected column
gman0104
Posts: 7Questions: 3Answers: 0
I have four columns in my table and i want to ignore the click on column 4. How can i achieve this via JavaScript
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Something like this
td:not(:nth-child(4))
. If this doesn't help please provide more details of what you are doing/. Maybe a code snippet of your event handler selector.Kevin
Hi my code is as follows
Yep, do what Kevin said above - replace
tr
with his suggestion.Colin
Sorry i forgot to include a line but if i update the code as follows im not getting a value for var value=$(this).find('td:first').html();
$('#myTable tbody').on('click', 'td:not(:nth-child(4))', function () {
var value=$(this).find('td:first').html();
setDate(value);
} );
Maybe something like this will work?
Kevin
Fab this has sorted my issue thanks kthorngren and Colin