javascript - Textarea automatic line break -


i have textarea on site want paste urls.

is possible create line break every time paste url? if not, can create line break when enter space?

i've searched solution found solution create line breaks after form submit didn't me.

fiddle here: https://jsfiddle.net/3sj2644z/

this.value = this.value + "\n"; 

you listen paste event on textarea , grab text in , append linebreak escape character \n , place new string value textarea.

you don't use html in textarea br tag doesn't work if think so.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -