Using jQuery, how can I make a textarea that automatically adds a new line when inserting text when the cursor is near the end.
The width of the textarea is dynamically done via CSS (e.g., #myTextArea { width: 80%; }
) so I can't do anything like counting the characters in each line.
I don't need a non-JS solution since the content of the textarea is only ever seen by JavaScript anyways.