Reputation: 233
I trying to get value of the closest using class name.
var remaningHoursValue = $(this).closest('td').find('.remainingHours');
I getting the value using id but by using class name i am not able to get result properly. result is [object, object]. From this result how to get the value in td.
Upvotes: 1
Views: 1345
Reputation: 12330
$('*').closest('td.remainingHours');
for text of the element
$('*').closest('td.remainingHours').text();
for log and alert()
alert($('*').closest('td.remainingHours').text());
Upvotes: 0
Reputation: 388326
you need
$(this).closest('td.remainingHours');
your selector, finds the closest td
element and searches for an element with class remainingHours
inside it
Upvotes: 2