Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

86
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!