PDA

View Full Version : JavaScript Function


surferdave
09-09-2002, 10:57 PM
Hello

I wrote the following code so when an user click "list" the list content will display "one, two, three, four"

<SCRIPT LANGUAGE="JavaScript">
function A()
{
list.innerText="One Two Three Four"
}
</script>


<p onclick = A()>List</p>
<p id ="list">&nbsp;</p>

Right now it will list Horizontally

one two three four

How do I make it list Vertically?

one
two
three
four

Do I need to create an array?

Thanks for your help

Dave

boywonder
09-09-2002, 11:35 PM
list.innerHTML="One<br>Two<br>Three<br>Four"

that should do it.

surferdave
09-09-2002, 11:42 PM
Thanks BoyWonder
you save the day again!!!