I am trying to separate each word with a newline in HTML/JS and IE6 and IE7 refuse to render the br tag, instead I get all in one line.
Here's the JS code: http://jsbin.com/atodur/edit#source
Is there any solution or workaround to this problem?
Thanks!
Problem is the code is not going into the else since word[i]
is undefined.
change
if (word[i] != " ")
to
if (word.charAt(i) != " ")
Basic Info:
word[i]
is non standard way of access the characters of a string.charAt()
is the standard wayString Character Access information