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

84
Vistas
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 Respuestas
Responde la pregunta

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 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