6
I have a jQuery code that detects when the key ENTER is pressed, but the event is also called when I use Shift + ENTER, for example.
How do I detect only the ENTER? The intention is to send the form only when the key ENTER is pressed, leaving the Shift + Enter for line breaking.
$(document).on('keyup', '.comment-textarea', function(event) {
if (event.which == 13) {
console.log('ENTER');
}
});
Thank you very much, Ricardo!
– Eduardo Silva