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

181
Views
How can I make multiple inputs every time I enter an input?

I am creating a google extension called manga extension. It all went well until I crossed with input. I like to put an input number every time I enter a manga name in the main input, naming it with chapter with input. But when I enter a new manga name, the value of every input I entered is lost. And I don't know how to put it inside of localStorage. How should I make it?

const divInput = []
const mangaName = document.getElementById('mangaNameInList')
// the manga name
const deleteBtn = document.getElementById('deleteBtn')
let mangaChapters = document.createElement('input')
let mangaLists = document.getElementById('mangaLists')
// the div i created in html
let count = 0
mangaName.addEventListener('keyup', function (event) {
    if (event.key == 'Enter') {
        count += 1
          mangaLists.innerHTML += `<p> ${mangaName.value} 
          <em>chapter</em>
          <input type="number" class="mangaChapters ${count}" 
          onkeyup="getValue(event)">
          </p>`
          // the input that i was conflicted with
       }
})

function getValue(event) {
    if (event.key == 'Enter') {
        mangaChapters = document.getElementsByClassName(`mangaChapters`)
        divInput.push(mangaChapters.value)
    }
}

every time I entered the main input (mangaName) and displaying it in the innerHTML, I just concatenate it with

and and that's the problem, how can I get the value of every declared input that I make in inside the mangaName?

<!DOCTYPE html>
<html lang="en">
<head>
       <meta charset="UTF-8">
       <meta http-equiv="X-UA-Compatible" content="IE=edge">
       <meta name="viewport" content="width=device-width, initial- 
       scale=1.0">
       <link rel="stylesheet" href="style.css">
       <title>Manga Extension</title>
</head>
<body>
       <h1>Manga Name Lists</h1>
       <input type="text" id="mangaNameInList">
       <button id="deleteBtn">DELETE ALL</button>
       <div id="mangaLists"></div>
       <script src="script.js"></script>
</body>
</html>

here's the html code. thanks for taking time to answer my coding question :)))

about 4 years ago · Juan Pablo Isaza
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!