I have a textbox (I usually call it like this: document.forms[0].text.value)
that has this kind of value:
a,b,c,d,e,f,g,etc
what I want to do is “explode” (like the php function) on each of the commas in the above string, then put it back into the textbox so I end up with this:
a
b
c
d
e
f
g
etc
Doing a little Googling I see I will need to use split() but doing something like:
st.split(",") + "<br />";
is giving me nothing but invalid results.
Either:
or:
Since you’re putting it in a textarea, by the look of things, you need newlines, not BR tags.