I am trying to return value from jQuery function. Here is my function:
$('#output').keypress(function (event){
var keycode = (event.keyCode ? event.keyCode : event.which);
if(keycode == '13'){
var read_lines = $('#output').val().split("\n");
return read_lines[read_lines.length-1];
}
});
and I want to save the value it return in another variable
var newRead = functionName(event);
alert (newRead);
How can I do this because I am not able to access function. Thanks in advance!