I've got some simple html a bit like this
<a href="" data-type="" data-id="" data-tags="" id="" class="">balrbalr</a>
I'd like to be able to get the full contents of <a>
as a string.
I know you can use .html
to get the inner html, however if I use
var string = $('a').html();
If would return, balrblabrlabr
If I do string = $('a').parent.html();
I'd get ALL of the <a>
's inside the parent.
how would I go about just getting the full html content of itself?