Kristi Castro has Published 91 Articles

How to detect Ctrl+Enter in textarea using jQuery?

Kristi Castro

Kristi Castro

Updated on 30-Jul-2019 22:30:23

81 Views

$(document).ready(function(){ $('#myinput').keydown(function(e) { var newkey = 'Key code = ' + e.which + ' ' + (e.ctrlKey ? 'Ctrl' : '') + ' ' + (e.shiftKey ? 'Shift' : '') + ' ' + (e.altKey ? 'Alt' : ''); $('#mykey').text(newkey); return false; }); });

Previous 1 ... 6 7 8 9 10
Advertisements