473,385 Members | 1,342 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

InnerHTML with long text

150 100+
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
3 2268
hsriat
1,654 Expert 1GB
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
6,050 Expert 4TB
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
16,027 Expert Mod 8TB
That's if you're using XHTML. For HTML, <br> is correct.
Jul 5 '08 #4

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

Similar topics

4
by: Mitch | last post by:
Here is some code I have bastardised from a few places, Obviously the innerHTML coding won't work in Mozilla, could anyone suggest a work around or fix? cheers, Mitch....
1
by: Christian Schmitt | last post by:
I have a page as follows: <HTML> <FRAMESET ROWS="20%, 80%"> <FRAME SRC="editor.html" NAME="editor"> <FRAME SRC="testfile.html" NAME="reader"> </FRAMESET> </HTML> editor.html contains the...
16
by: Joel Byrd | last post by:
I am having this ridiculous problem of trying to set the innerHTML of a div node. It works in all other browsers, but internet explorer is giving me an "Unknown runtime error". This is actually...
9
by: Hallvard B Furuseth | last post by:
Why does the FAQ (Q 4.15) recommend innerHTML when so many here say one should use createElement(), replaceChild() etc? Also, why does the "Alternative DynWrite function" at...
2
by: Jake Barnes | last post by:
In the function below I use a call to Prototype to get some text from another webpage and I fill a div with it. You can see the red, narrow div halfway down this page: ...
6
by: sonic | last post by:
Ok, i am sure everyone is sick of hearing about this. but i've checked about 10 different posts/sites about this issue, and they all say "use DOM" but i think there is more to be said. Perhaps I...
9
by: martymix | last post by:
simple question: I have a simple <dt>test text</dt> I get the innerHTML of that dt, and I try and append some text to it like so: dt = document.getElementsByTagName('dt') var text =...
2
by: Denis McMahon | last post by:
Hi A relative has a web page that they want to work with google checkout, so it has to be xhtml, as the google scripts require xhtml. However, I wish to replace the text content of an id'd...
1
by: ppRaistlin | last post by:
Hi, I understand that it s a very rare question that I m ready to ask and that only few people can actually test but a theoric explanation and solution will be really grateful. Here is my...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.