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
Post a Comment