I am tryin to put to display the elements of an array, with each element of the array on a seperate line.
<script type="text/javascript">
var names = prompt("Enter Names:","Enter names here.");
var names_array = [names.split(" ")];
var array_length = names_array.length;
var i = 0;
var array_display = names_array.join("<br>");
for (i;i<array_length;i++)
{
document.write("You entered the following names:"+"<br>"+array_display)
}
</script>
Please, anyone, what am I doing wrong here? It is probably the simplest thing, but for the life of me, I can't figure out what works.
Thanks in advance