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

135
Views
how to save input data from input js?
  let card = document.createElement('div')
  card.classList.add('card')
  card.innerHTML = `
      <input type="text" placeholder="write word" class="card-word"></input>
      <input type="text" placeholder="write translate" class="card-translate"></input>
      <input type="text" class="card-info"></input>
    `;
    cards.insertBefore(card, addBtn);

it is necessary that when the user enters data, they are saved and stored, so that when the page is reloaded, they are saved

I also want to ask you for advice on how to do it better

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can hook onChange event with your dynamic elements like this

<input type="text" placeholder="write word" class="card-word"
       value="localStorage.getItem(\'yournameforthisfield\')"
       onchange="localStorage.setItem(\'yournameforthisfield\', this.value)"></input>

then on submit you can use localStorage.getItem to retrieve these field values.

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!