I have a HTML code with div container and another HTML element and text inside it
<div id="container"><i class="myico"></i> text</div>
I need to get only HTML element from the container without the text.
So i need to get only
<i class="myico"></i>
How can I get it using jQuery?
Simply to get the element use one of the following:
To get the element out of the markup use
detach():Then to get an HTML code, you may use
outerHTMLproperty:DEMO: http://jsfiddle.net/tLvdZ/