I have a program that involves Javascript to allow for interaction with a webpage. It\'s a baseball site so what I am doing is prompting the user to enter a month. The user
You can use .join()
to combine the array into one string, and separate each entry by
:
document.getElementById("result").innerHTML =
schedule.join("
");
There's no need for the self-closing /
in
. More important, there's no need for the for
loop. That code above will do the whole thing.
If you want a
after the last entry, just add it:
document.getElementById("result").innerHTML =
schedule.join("
") + "
";