Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

240
Vistas
is there an alternative to onfocusout() function?

I have the function onfocusout() that runs another function selectEntite(), inside an input like the following code :

<input onfocusout="selectEntite();" type="text" placeholder="Entité" id="entityName" class="inputSelect" name="entityName" style="width: 60%" />

when the user leave the input, the function run. i want to change it until the user tap the keyboard enter.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Try this:

<input onkeydown="selectEntite(this);" type="text" placeholder="Entité" id="entityName" class="inputSelect" name="entityName" style="width: 60%" />
function selectEntite(ele) {
    if(event.key === 'Enter') {
        alert(ele.value);        
    }
}
about 4 years ago · Juan Pablo Isaza Denunciar

0

you can add an addEventListener() to the input field that listens for key presses. Then check if enter is pressed, then you can execute some code. –

let el = document.getElementById("entityName")
el.addEventListener("keydown",(event) => {
    if (event.key === "Enter") {
        // Enter key was hit
    }
})
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda