Answer the question
In order to leave comments, you need to log in
How to create a complex div from multiple divs?
It is desirable that all this happens at the click of a button.
Answer the question
In order to leave comments, you need to log in
as usual, createElement / $(tag), but at least shove it into innerHTML, at least use template, there are a lot of options
$('.btn').click(function() {
$('body').append("<div class='newBlock'></div>");
for(i=1; i<=10; i++)
$('.newBlock').append("<div class ='newSubBlock'></div>");
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question