Answer the question
In order to leave comments, you need to log in
Why is JS not rendering content?
Hello!
There was a need to add the HTML code (1) to the page in the DIV, then add the DIV code (2) to the inserted code (1).
Page:
<div id="block"></div>
Add like this:
(1)
document.getElementById('block').innerHTML = '<div id="button"></div>';
<div id="block"><div id="button"></div></div>
document.getElementById('button').innerHTML = '<div id="button_2"></div>';
var emptyQ = $('#button').is(':empty');
if (emptyQ == true) { timerQ = setInterval(function(){ выполнить (2); остановить таймер, если emtyQ false;}, 500); }
document.getElementById('button').innerHTML
Answer the question
In order to leave comments, you need to log in
let button1 = document.createElement('div');
button1.id = 'button';
let button2 = document.createElement('div');
button2.id = 'button_2';
button1.appendChild(button2);
document.getElementById('block').appendChild(button1);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question