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

210
Views
¿Es posible pasar el valor de <p> a <input>?

Tengo un <p> que imprime un valor, ¿es posible que el valor se pueda imprimir en el <input> ?

por ejemplo:

 <p>2</p> <input type="number">2</input>
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Esto requerirá el uso de Javascript. Agregue una id a su párrafo e ingrese para que pueda identificarlos, luego establezca el value de su campo de entrada en el textContent de texto de su párrafo:

 let myParagraph = document.getElementById('my-paragraph'); let myInput = document.getElementById('my-input'); myInput.value = myParagraph.textContent;
 <p id="my-paragraph">2</p> <input type="number" id="my-input"/>

about 4 years ago · Juan Pablo Isaza Report

0

El elemento de Input tiene un atributo llamado value .
Así que puedes hacer -

 <input type="number" value=2 />
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!