Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

262
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda