All I am trying to do is insert new lines instead of the <br />
That
string in dose is what I am getting from the backend and in the front I want new lines instead.
The code below just gives me spaces. Can anyone please help me with this? I dont understand what I am doing wrong.
<html>
<body>
<script type="text/javascript">
var dose = "& lt;br /> ;Here& lt;br /& gt;is a new& lt;br />line& lt;br /& gt;for you";
dose = dose.replace(/& lt;br \/& gt;/g,"& #010;& #013;");
document.write(dose);
</script>
</body>
</html>
The output is "Here is a new line for you"
Please note - I have added the space after & on purpose else the character entiry would be replaced
Thanks
[ April 24, 2007: Message edited by: Gayatri Sinha ]
[ April 24, 2007: Message edited by: Gayatri Sinha ]