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

85
Visualizações
i don't know how to add the user input back to the DOM and i think its something with my js code

I don't konw what to do

I need help with this js script and I just need to know how to show a user input in a html styled templet that I made but I just don't don't known how

<!-- add email side nav -->
<div id="side-form" class="sidenav side-form">
  <form class="add-email container section">
    <h6>add a new email</h6>
    <div class="divider"></div>
    <div class="input-field">
      <input keypath="email" placeholder="example@gmail.com" id="title" type="text" class="validate">
      <label for="title">write email here</label>
    </div>
    <div class="input-field">
      <label>
        <input type="checkbox" />
        <span>Notifications</span>
      </label>
    </div>
    <br>
    <div class="input-field center">
      <button class="btn-floating blue pulse" id="add_email" onclick="getValue()">Add</button>
    </div>
  </form>
</div>

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Add this to your JS file or <script> tag:

const userInput = document.getElementById("title")

userInput.addEventListener("keyup", (e) => {
    // append e.target.value to the page
    document.createElement("p").innerText = e.target.value;
});

The above will append a paragraph to your page with the value of the email in it. It is now part of the Dom. Obviously, you will change the logic inside the event listener to render it to your page appropriately. Alternatively, you can set an event listener to the add-button and render it from there.

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