I have a global JavaScript array that contains some strings.
I want to create a dynamic list based on the strings in my JavaScript array. Similar to this:
Yes you can. You can either user the DOM directly with createElement (see Jonathan's answer), or go an very easy route with jQuery (not tested):
var ul = "";
for(var i=0; i < arr.length; i++) {
ul += "- " + arr[i] + "
";
}
ul += "
";
var ulElem = $(ul);