I\'m using jquery, and I have a textarea. When I submit by my button I will alert each text separated by newline. How to split my text when there is a newline?
Just
var ks = $('#keywords').val().split(/\r\n|\n|\r/);
will work perfectly.
Be sure \r\n is placed at the leading of the RegExp string, cause it will be tried first.
\r\n