JQUERY, TEXT, appending an LI to a list with a SPAN wrapped?
Posted
by nobosh
on Stack Overflow
See other posts from Stack Overflow
or by nobosh
Published on 2010-03-08T04:29:56Z
Indexed on
2010/03/08
4:36 UTC
Read the original article
Hit count: 217
jQuery
here is my current line of code:
$("<li>").text($(this).text()).appendTo("#theList");
Which results in
<ul id="theList">
<li>blah</li>
<li>blah</li>
</ul>
How can I update that code above to result in:
<ul id="theList">
<li><span>blah</span></li>
<li><span>blah</span></li>
</ul>
© Stack Overflow or respective owner