I have a list of elements.
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ul>
$(function() {
var liNodes = $("li");
liNodes.each(function(index, value) {
var span = $("<span></span>");
value.append(span);
console.log(value);
});
});
I want to iterate over the li elements, appending a span class to each but instead it displays this:
- One[object Object]
- Two[object Object]
- Three[object Object]
What am I doing wrong here? thank you