1$('#usersearch').keydown(function(e){
2 if(e.keyCode === 13){
3 alert("Enter was pressed ");
4 }
5});
1var el = document.getElementById("myInputID");
2el.addEventListener("keydown", function(event) {
3 if (event.key === "Enter") {
4 // Enter key was hit
5 }
6});