Hi,
I'm using jquery to parse some HTML, something like:
$(html).contents().each(function(){
var element = this.tagName;
...
I can access the tagName, children, parent... using the DOM or the more friendly jQuery functions.
But at one point a need the whole HTML of the current element (not what innerHTML
or .html()
return) and I can't figure out a one liner to get it (I always could attach the tag and the attributes manually to the innerHTML).
For example:
<a href="link">Link</a>
The innerHTML
is Link
but I'm looking for the whole <a href="link">Link</a>
does that oneliner exists?
Thank you.