For example, if I have an HTML list ul, for example
<ul id="ulIdentificator">
<li id="li0"></li>
<li id="li1"></li>
<li id="li2"><label id="label1"></label></li>
</ul>
If I use jQuery as follows
var htmlStr = $("#li2").html();
The result will be only a string containing the tag tag. <LABEL id="label1"></LABEL></li>I need to get an HTML string containing this<LI id="li2"><LABEL id="label1"></LABEL></LI>
nemke source
share