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

121
Views
La entrada de texto HTML activa el evento de cambio demasiado tarde

Tengo un problema con mi entrada, donde llama a mi evento de cambio, solo después de hacer clic fuera de la entrada. Quiero que se llame al evento cuando el usuario agregue texto a mi entrada.

 function textChange(ele) { let btn = document.getElementById("addThingBtn"); if (ele.value.length) btn.disabled = false; else btn.disabled = true; }
 input { height: 35px; float: left; text-align: center; } button { width: 120px; height: 40px; float: left; text-align: center; margin-left: 5px; }
 <input type="text" id="newThingName" onchange="textChange(this);" placeholder="new thing name"> <button id="addThingBtn" onclick="addThing();" disabled> Add thing </button>

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

0

En realidad, estaba buscando el evento de entrada, no el evento de cambio.

 function textChange(ele) { let btn = document.getElementById("addThingBtn"); if (ele.value.length) btn.disabled = false; else btn.disabled = true; }
 input { height: 35px; float: left; text-align: center; } button { width: 120px; height: 40px; float: left; text-align: center; margin-left: 5px; }
 <input type="text" id="newThingName" oninput="textChange(this);" placeholder="new thing name"> <button id="addThingBtn" onclick="addThing();" disabled> Add thing </button>

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!