$(document).on('keydown', document, function (e) { var e = event || window.event || arguments.callee.caller.arguments[0]; if (e && e.keyCode == 13) { $('#login').trigger('click'); } });