Replace Line breaks

S

Sunny

Hi does anyone knows, How to remove line breaks from a string using
javascript.
I have a string like:
<div> <div class="style1">Yates<br>-47.13

but somehow the javascript is displaying string "-47.13"
as
-
47.13
It is treating a "-" sign as a line break.
Any comments.
 
D

Dr J R Stockton

Hi does anyone knows, How to remove line breaks from a string using
javascript.
I have a string like:
<div>  <div class="style1">Yates<br>-47.13

but somehow the javascript is displaying string "-47.13"
as
-
47.13
It is treating a "-" sign as a line break.
Any comments.

Wrapping the entire number -47.13 as <nobr>-47.13</nobr> could fix it,
at least in IE7.
 
S

Sunny

Wrapping the entire number -47.13 as <nobr>-47.13</nobr> could fix it,
at least in IE7.

--
(c) John Stockton, near London, UK. Posting with Google.
Mail: J.R.""""""""@physics.org or (better) via Home Page at
Web: <URL:http://www.merlyn.demon.co.uk/>
FAQish topics, acronyms, links, etc.; Date, Delphi, JavaScript, ....|

Hi Thanks, It fixed the problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,158
Latest member
Vinay_Kumar Nevatia
Top