Suppose I have the following HTML element:
<span id='kuku' class='lala bubu' value='xyz'>some text</span>
I know that .html() returns the inner part of the element, i.e. some text.
How could I get the whole element as string, containing <span>...</span>?
Most browsers support the
element.outerHTMLproperty. You may also want to check out the following Stack Overflow post for an alternative solution (for non IE browsers):