By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,818 Members | 2,121 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,818 IT Pros & Developers. It's quick & easy.

InnerHTML with long text

100+
P: 150
i need to enter long text having line brakes into div tag by innerHTML command
this is an example of the text i want to enter:
cat
car
dog
boy
it give me an error unterminated string literal
Jul 4 '08 #1
Share this Question
Share on Google+
3 Replies


hsriat
Expert 100+
P: 1,654
What's the need of line breaks inside the text? It won't be shown as line breaks in the HTML anyhow.
If you want to give line breaks, use <br>.

Is that it or I couldn't get it?
Jul 4 '08 #2

Markus
Expert 5K+
P: 6,050
What's the need of line breaks inside the text? It won't be shown as line breaks in the HTML anyhow.
If you want to give line breaks, use <br>.

Is that it or I couldn't get it?
<br /> if you want to be technical ;]
Jul 4 '08 #3

acoder
Expert Mod 15k+
P: 16,027
That's if you're using XHTML. For HTML, <br> is correct.
Jul 5 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.