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

138
Views
cómo poner el cursor del cuadro de entrada al final del texto

Quiero agregar un número en el campo de entrada al hacer clic en el botón y establecer la posición del cursor al final del texto. esto debería suceder cada vez que se hace clic en el botón.

 <input id="input"></input> <button onclick="addnumber()">add</button> addnumber(){ }
about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

<input id="input"></input> <button onclick="addnumber()">add</button> <script> function addnumber() { const myInput = document.getElementById('input'); const textLength = myInput.value.length; myInput.focus(); myInput.setSelectionRange(textLength, textLength); } </script>
about 4 years ago · Juan Pablo Isaza Report

0

 let input = document.getElementById('input') function addnumber() { input.value=69 input.focus() }
 <input id="input"> <button onclick="addnumber()">add</button>

about 4 years ago · Juan Pablo Isaza Report

0

Código JS:

 let input = document.getElementById('input') function addnumber() { input.focus(); var val = this.input.value; input.value = ''; input.value = val; }

Código HTML:

 <input id="input"> <button onclick="addnumber()">add</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!