Answers for "submit on enter"

8

press button on enter

searchInput.onkeyup = function (e) {
    if (e.key === 'Enter') {
        searchBtn.click();
    }
}
Posted by: Guest on March-11-2021
1

on enter press button

<input onkeyup="if(event.keyCode===13){submit.click()}"><button id="submit">submit</button>
Posted by: Guest on September-24-2021
1

How to trigger button using enter keyword in an input box?

document.getElementById("pw")
    .addEventListener("keyup", function(event) {
    event.preventDefault();
    if (event.keyCode === 13) {
        document.getElementById("myButton").click();
    }
});

function buttonCode()
{
  alert("Button code executed.");
}
Posted by: Guest on February-05-2022

Code answers related to "Assembly"

Browse Popular Code Answers by Language