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!
2
Answers
You need to fix the attribute
class
enclosed with"
:First of all you have a little html error.
You should change your div as below
and your jQuery code:
And here is a demo for your case https://jsfiddle.net/gfLajh07/