Answers for "on key down enter and click button in a function javascript"

1

button onclick enter key

$("#id_of_textbox").keyup(function(event) {
    if (event.keyCode === 13) {
        $("#id_of_button").click();
    }
});
Posted by: Guest on June-01-2021
0

on key down enter

const textbox = document.getElementById("txtSearch");
textbox.addEventListener("keypress", function onEvent(event) {
    if (event.key === "Enter") {
        document.getElementById("btnSearch").click();
    }
});
Posted by: Guest on March-11-2022

Code answers related to "on key down enter and click button in a function javascript"

Code answers related to "Assembly"

Browse Popular Code Answers by Language