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?
Since you are using textarea, you may find \n or \r (or \r\n) for line breaks. So, the following is suggested:
textarea
$('#keywords').val().split(/\r|\n/)
ref: check whether string contains a line break