javascript - How to get the new line break if there are some in the text area -



javascript - How to get the new line break if there are some in the text area -

i have textarea , want, when post form if there new lines in text area them , output text them, wysiwyg editors does.

what can't understand

i have form , want te text area value on post if there new lines in value of text area want when output text form geted new lines displayed actualy new lines wysiwyg editors>

line breaks interpreted \n.

with javascript can utilize regular look observe new line character.

regex:

/\n/

update:

var newstr = "string line breaks".replace(/\n/g,"<br />");

this replace new line in textarea <br> tag create new line

javascript html

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -