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

275
Vistas
HTML JS , Append a new div to html body

i wanna add a new div,created with js, to the html file.I use cpanel as storage.

html

<div class="row onerow"></div>

js

 $( "<div></div>" ).appendTo( ".onerow").addClass("col")

I wanna save that new div i just created on the html body.Right now the div is deleted on page refresh.

Full story: I have to create a website that contains a one row gallery.I wanna create a script where the admin can upload a photo and that photo will join the row as a new col.Upload is ready,but now i have to figure how to save the col to html body.Thank you for your time!

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

0

First of all you have a little html error.

You should change your div as below

<div class="row onerow"></div>

and your jQuery code:

$(document).ready(function() {
  $('.onerow')
    .append('<div>new div</div>')
    addClass('abc');
});

And here is a demo for your case https://jsfiddle.net/gfLajh07/

about 4 years ago · Juan Pablo Isaza Denunciar

0

You need to fix the attribute class enclosed with ":

<div class="row onerow"></div>
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