input on press code example
Example: javascript detect enter press on input
var el = document.getElementById("myInputID");
el.addEventListener("keyup", function(event) {
if (event.key === "Enter") {
// Enter key was hit
}
});
var el = document.getElementById("myInputID");
el.addEventListener("keyup", function(event) {
if (event.key === "Enter") {
// Enter key was hit
}
});