line breaks - Linebreak in a String in JavaScript -


i want make linkebreak in string. in html it's (if replace t linkebreak): mystring.replace("t", "<br>");

but doesn't work in javascript. <br> part of string too. how implement in javascript? thanks!

mystring before linkebreak:

2013-10-22t22:56:25.534z

mystring after linebreak:

2013-10-22t

22:56:25.534z

you can achieve doing :

var mystring = "2013-10-22t22:56:25.534z";  console.log(mystring.replace("t", "\n")); 

demo


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

python - Django-cities exits with "killed" -

python - How to get a widget position inside it's layout in Kivy? -