Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Javascript linebreak

Reply
Thread Tools

Javascript linebreak

 
 
Shirenseru
Guest
Posts: n/a
 
      05-02-2006
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..

 
Reply With Quote
 
 
 
 
Randy Webb
Guest
Posts: n/a
 
      05-02-2006
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/
 
Reply With Quote
 
 
 
 
Shirenseru
Guest
Posts: n/a
 
      05-02-2006
Oh my god..

was it that easy.. '-_-

Thanks a lot man!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Eclipse - how to change to option: automatic-linebreak S Java 5 12-09-2005 10:51 AM
Headline without linebreak Alex Funke HTML 3 08-30-2004 09:36 PM
Remove linebreak before header Tim Johansson HTML 5 08-18-2004 02:48 PM
linebreak in <select>-menu? Alexander Ryck HTML 1 03-07-2004 10:16 PM
Linebreak problem on the interactive interpreter Win2k Jonas Galvez Python 0 02-20-2004 07:09 AM



Advertisments