Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR ASSEMBLY

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.");
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #trigger #button #enter #keyword #input
ADD COMMENT
Topic
Name
4+4 =