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

100
Vistas
Is there any cleaner way to create a div in jQuery? I'm currently concatenating every HTML line

I'm looping over an array of images, creating the div that will contain all the information and then appending it to the div that will contain them. What I've done is working just fine, however, I've been wondering if there's a cleaner way to do what I'm doing right now:

    artworks.records.forEach((artwork, i) => {
        const record = `<div class='artwork'>` +
            `<div class='artwork-image-container'>` +
                `<img class="artwork-image" src="${artwork.images.length > 0 ? artwork.images[0].baseimageurl : './assets/no-image-available.png'}" alt="${artwork.title}" />` +
            "</div>" +
            "<div class='image-description-container'>" +
                `<p class="image-description">${artwork.title}</p>`
            "</div>" +
        "</div>";
        divToBeRenderedIn.append(record);
    });
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