Let\'s say I have an object which looks like that:
var users = [\'user1\', \'user2\'];
For this object I would like to create a list of span li
Assuming users should contain strings only, try this:
users
var users = ['user1', 'user2']; for (var i = 0; i < users.length; i++) { $("").text(users[i]).appendTo("body"); };
Example fiddle