Search
 
SCRIPT & CODE EXAMPLE
 

ASSEMBLY

click button when press enter javascript

var input = document.getElementById("myInput");

// Execute a function when the user releases a key on the keyboard
input.addEventListener("keyup", function(event) {
  // Number 13 is the "Enter" key on the keyboard
  if (event.keyCode === 13) {
    // Cancel the default action, if needed
    event.preventDefault();
    // Trigger the button element with a click
    document.getElementById("myBtn").click();
  }
});
Comment

on enter press button

<input onkeyup="if(event.keyCode===13){submit.click()}"><button id="submit">submit</button>
Comment

button onclick enter key

$("#id_of_textbox").keyup(function(event) {
    if (event.keyCode === 13) {
        $("#id_of_button").click();
    }
});
Comment

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.");
}
Comment

PREVIOUS NEXT
Code Example
Assembly :: pyplot name axes 
Assembly :: ror loading webview: Error: Could not register service workers: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state.. 
Assembly :: error: failed to synchronize all the database archlinux 
Assembly :: discord bot remove message 
Assembly :: wget output filename 
Assembly :: that long word from mary poppins 
Assembly :: what do you mean by io address and memory address 
Assembly :: dd utility seek 
Javascript :: jquery vslidation remove spaces from input 
Javascript :: javascript months array 
Javascript :: mac address validation regex 
Javascript :: redirect to link using jquery on new tab 
Javascript :: how to insatll react-router-dom 
Javascript :: kill all node processes 
Javascript :: remove attribute in jquery 
Javascript :: changing columns for table requires doctrine dbal install doctrine/dbal 
Javascript :: get tomorrows date using moment 
Javascript :: for each loop class jquery 
Javascript :: flash input 
Javascript :: add 24 hours to string date javascript 
Javascript :: react native rotate 
Javascript :: javascript random color generator 
Javascript :: Uncaught TypeError: firebase_app__WEBPACK_IMPORTED_MODULE_4__.default.storage is not a function 
Javascript :: react native cover image 
Javascript :: how to use another port in angular 
Javascript :: javascript clear div 
Javascript :: react native cover image in parent view 
Javascript :: apex charts cdn 
Javascript :: how to displayan inteiger to a tenth in javascript 
Javascript :: showing difference between dates in minutes js 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =