Reputation: 2337
I'm trying to find a particular class match from a closest element
$(this).closest("tr");
I need to find out if this tr has a class name testlog3 from the point.
Upvotes: 1
Views: 68
Reputation: 128991
Use hasClass
:
if($(this).closest('tr').hasClass('testlog3')) {
// ...
Upvotes: 2
Reputation: 86413
You can use the closest function as follows:
$(this).closest('tr.testlog3');
Upvotes: 2