473,320 Members | 1,987 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,320 software developers and data experts.

Javascript linebreak

Hello guys, i hope you can help me with this cause it's driving me
crazy!

I got the following statement in javascript:

if(currTotal < 27{document.getElementById('isResult').innerHTML =
"Blabla, blablabla, 12345")

it displays the message as:

Blabla, blablabla, 12345

But i would like to break it up into three lines, so it would be
displayed as:

Blabla,
blablabla,
12345

Is there anyone that knows how to fix this? I tried \n , but with no
result..

May 2 '06 #1
2 3976
Shirenseru said the following on 5/2/2006 9:07 AM:
Hello guys, i hope you can help me with this cause it's driving me
crazy!

I got the following statement in javascript:

if(currTotal < 27{document.getElementById('isResult').innerHTML =
"Blabla, blablabla, 12345")

it displays the message as:

Blabla, blablabla, 12345

But i would like to break it up into three lines, so it would be
displayed as:

Blabla,
blablabla,
12345

Is there anyone that knows how to fix this? I tried \n , but with no
result..


Add a <br> or <p> to it as you are rendering HTML and \n is not a new
line in HTML. \n will add a new line to the source though.

"Blabla,<br> blablabla,<br> 12345<br>"

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 2 '06 #2
Oh my god..

was it that easy.. '-_-

Thanks a lot man!

May 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: nAmYzArC | last post by:
Hi everyone, I'm setting the body of an email using values from a form firstname = bob lastname = dole ebody = 'First Name: ' + firstname + '\r\n' + 'Last Name: ' + lastname ...
1
by: Lucie | last post by:
Hi, I've created a form with 2 dialoglist fields: 1 state and 1 city. I want to select a state, and I need a way to build the city list. In order to do this, I've used the onChange event (on the...
4
by: Dirk Reske | last post by:
Hey, I have following struct: struct Packet { string Command; byte data; }
2
by: Georg Weiler | last post by:
Hi, I have a form, where the user enters text. After submit, the text is then inserted into a PostgreSQL database. So far, so good. The problem is, that most of my users copy&paste their text...
17
by: Chris Ianson | last post by:
Hi, I have this JavaScript, which I only want to occur if a user clicks on a hyperlink hotspot in a large image: <script type="text/javascript"> <!-- var answer = confirm ("This link is not...
3
by: Michael Hamm | last post by:
My page http://www.math.wustl.edu/~msh210/whatsnew.xml (with XSLT and CSS adding formatting) has a paragraph-type break after "Subscribe to this feed" which, afaIct looking at the source code,...
3
by: Per W. | last post by:
Hi, is it possible to have Literal using linebreaks? If i have a textfile with more than 1 line then Literal take all on one line. /Per W.
7
by: Leif902 | last post by:
After much searching of google, the closest I can find is highlighting search terms... however, this is not what I wanted to do. Does anyone know how to parse through a specific element (lets say...
2
by: wannasee | last post by:
Hello everybody, I am new at javascript and I would like to write a script that resizes the input fieds of an html table depending on the entered text. The input fields are placed in table cells...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.