First off sorry for this beginner question but I just recently learned JavaScript and I am now learning to develop Windows 8 apps. Here is the code in question:
var numbers = [1, 2, 3, 4, 5];
id('numberList').innerHTML = '<ul>';
for (var x in numbers) {
id('numberList').innerHTML += '<li>' + x + '</li>';
}
id('numberList').innerHTML = '</ul>';
I have this in the ready function (for any Windows 8 developers) in my JS file and 'numbersList' refers to a section tag in the body (of the HTML file). The list does not show up at all when I am running the app. However when I simply try to add text instead of a list like so
id('numberList').innerHTML = 'hello';
the text does show up. Could there be a problem with the way I am trying to insert the html elements?