I'm trying to display elements of a JavaScript array. Code:
var name = ["one" , "two"];
window.onload = function(){
document.getElementById('MinamaisVards').innerHTML=name[1];
}
Can anyone tell me why does it display the letter "n" instead of the second element of array? I don't understand where the problem is.
namebefore thewindow.onloadevent is being fired.