Note that the a
element is being created, so that the text
and href
attributes are applied to it. Then it's wrapped in an li
, and using parent()
to grab that li
, is appended to the #contributors
element.
for (var i = 0; i < projects.length; i++) {
$('<a />', {
href: '#',
text: projects[i].author
}).wrap('<li />').parent().appendTo('#contributors');
}