selladurai selladurai - 1 year ago 131
Javascript Question

How to create list in HTML dynamically?

In my jQuery mobile app, I want to display the result from a web service in a list. How do I create the list dynamically?

Answer Source
var arr = ["list", "items", "here"];
for(var i in arr) {
    var li = "<li>";