Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

235
Views
¿Hay alguna alternativa a la función onfocusout()?

Tengo la función onfocusout() que ejecuta otra función selectEntite() , dentro de una entrada como el siguiente código:

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

cuando el usuario deja la entrada, la función se ejecuta. quiero cambiarlo hasta que el usuario toque el teclado enter.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Prueba esto:

 <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 Report

0

puede agregar un addEventListener() al campo de entrada que escucha las pulsaciones de teclas. Luego verifique si se presiona enter, entonces puede ejecutar algún código. –

 let el = document.getElementById("entityName") el.addEventListener("keydown",(event) => { if (event.key === "Enter") { // Enter key was hit } })
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!