I'm using jquery to get a row
<tr class="phoneNumber">
ABC...
</tr>
and when i do $(".phoneNumber").html(), it returns ABC...
Is there a way to get
<tr class="phoneNumber">
ABC...
</tr>
Thanks in advance
I'm using jquery to get a row
<tr class="phoneNumber">
ABC...
</tr>
and when i do $(".phoneNumber").html(), it returns ABC...
Is there a way to get
<tr class="phoneNumber">
ABC...
</tr>
Thanks in advance
(function($) {
$.fn.outerHTML = function() {
return $(this).clone().wrap('<div></div>').parent().html();
}
})(jQuery);
$('.phoneNumber').outerHTML();
Use outerHTML
:
$('.phoneNumber')[0].outerHTML
Or, if compatibility is important to you, use one of the extensions listed at Get selected element's outer HTML.