I am working on a script where through a loop buttons are formed with different onClick parameters, but when my html document opens and calls the function, nothing happens. Can some look at the code and tell me what I am obviously doing wrong. Note: I am a beginner and experitmenting to learn.
My Code:
My Code:
Code:
buttonNames = new Array("Next","Previous","Home");
function displayButtons{
for (i=0; i < buttonNames.length; i++)
<input type="button" value= buttonNames[i]
for (i in buttonNames)
{
window.location = new array("next.html","previous.html","home.html");
onClick="window.location[i]";
}>
Comment