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

207
Vistas
Using javascript to populate a html table

Im trying to add input where you can select different options for a location. my issue is that its messing up the table and it just does not see me new input option that i've added. I can list other files or pictures if needed.

Before

        var items = 0;
        function addItem() {
            items++;

            var html = "<tr>";
                html += "<td>" + items + "</td>";
                html += "<td><input type='number' name='idNumber[]'></td>";
                html += "<td><input type='text' name='itemName[]'></td>";
                html += "<td><input type='number' name='itemQuantity[]'></td>";

                html += "<td><select name='itemLocation[]' id='location'><option value="Shop" name="Shop">Shop</option></select></td>";

                html += "<td><input type='text' name='itemIndex[]'></td>";
                html += "<td><button type='button' onclick='deleteRow(this);'>Delete</button></td>"
                html += "</tr>";

With trying to use input with different options

Just trying to change to location button to a multiple choice selection

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

you have double quotes inside your string which is breaking your template to avoid this kind of error you should use template literals its fully supported

Note it is backtick (`) not singlequote (')

see example

var value = "new entry"
var tr = `
<tr>
    <td>${value}</td>
    <td>${value}</td>
    <td>${value}</td>
    <td>${value}</td>
    <td>${value}</td>
</tr>
`
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