$('#twitterSearch').keydown(function(event){ var id = event.key || event.which || event.keyCode || 0; if (id == 13) { $('#startSearch').trigger('click'); } });