I am working on an example and want I want to do now is to catch the value of some rows in a text area after pressing ENTER.
I have detected the ENTER key press using this JQuery function:
$('#output').keypress(function(event){
var keycode = (event.keyCode ? event.keyCode : event.which);
if(keycode == '13'){
var read_lines = $('#output').val().split("\n");
alert(read_lines);
}
});
and I try to catch the values in the #output
text area using this:
var read_lines = $('#output').val().split("\n");
alert(read_lines);
but it catch all the text in the text area not only the one I insert before pressing Enter key.
Can you please help me?
Here is my DEMO.