I have a textarea on my site where I want to paste URLs.
Is this possible to create line break every time I paste URL? If not, can it create line break when I enter space?
I've searched for the solution but all i found is the solution to create line breaks after form submit which didn't help me.
Fiddle here: https://jsfiddle.net/3sj2644z/
You listen for the paste event on the textarea and you grab the text that is currently in it and append a linebreak with the escape character \n to it and then place that new string value back into the textarea.
You don't use html in the textarea so the br tag doesn't work if you think so.