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

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