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

263
Vistas
how can i put what i input on the box in the output. thank you

where to put output

code

cant put the entire code sorry on the body so i just put it on picture

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The first problem is preventing the page from loading and to do that, we pass the event object and use the preventDefault() method to stop the reload. Once that is done we grab the values of the input elements and use innerHTML to display it inside the

element with the help of the fancy template literals.

Here's the button

<button onClick="handleSubmit(event)">Submit</button>

Here's the JavaScript code

function handleSubmit (e) {
  e.preventDefault()
  let name = document.getElementById("fname").value
  let age = document.getElementById("age").value
  let email = document.getElementById("email").value
  document.getElementById("demo").innerHTML = `Name is : ${name} Age is: ${age} 
  and Email is : ${email}`;
}

Here's the code pen for this

Code Pen

I would not recommend implementing my answer as it is very unpolished and might cause problems in the long run, but I hope it helps.

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