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

219
Vistas
Is it possible to pass value of <p> to <input>

I have a <p> that prints a value is it possible that the value can be printed in the <input>?

for example:

<p>2</p>

<input type="number">2</input>
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

This will require the use of Javascript. Add an id to your paragraph and input so you can identify them, then set the value of your input field to the textContent of your paragraph:

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 Denunciar

0

Input element has an attribute called value.
So you can do -

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