HTML:
<div id="twitter" style="float:left;">
<span></span>
</div>
jQuery:
var obj = JSON.parse(data);
$.each(obj.items, function (i, item) {
$("span", this).html("('<p>" + item.title + "</p>')").appendTo("#twitter");
if (i == 5) return false;
});
I'm obviously doing something wrong, and can't seem to figure this out. I know the $.each method works, as I'm able to put alert(item.title) and get the expected result.
Basically all I want to do is, loop through the item and output:
<p> title </p>
<p> title 2 </p>
I just can't seem to figure this out