“Botón OnClick Ingrese la tecla” Código de respuesta

Haga clic en el botón Cuando presione Intro 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();
  }
});
Maeron Reyes

Presione el botón Enter Enter

searchInput.onkeyup = function (e) {
    if (e.key === 'Enter') {
        searchBtn.click();
    }
}
Arno Deceuninck

Botón OnClick Ingrese la tecla

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

Respuestas similares a “Botón OnClick Ingrese la tecla”

Preguntas similares a “Botón OnClick Ingrese la tecla”

Más respuestas relacionadas con “Botón OnClick Ingrese la tecla” en JavaScript

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código