Answer the question
In order to leave comments, you need to log in
Is it possible to copy an html tag with all inner tags and paste in another tag in wordpress using javascript?
Hello, is it possible to copy an html tag with internal tags and paste it inside another tag using javascript? On wordpress?
For example:
<!--Этот блок кода html скопировать-->
<div class="asdasd">
<div class="asdasd">
<div class="asdasd">
blabla
</div>
</div>
</div>
<!--И вставить в этот тег ниже который-->
<div class="dsadsa"></div>
Answer the question
In order to leave comments, you need to log in
HTML:
<div class="asdasd-1">
<div class="asdasd">
<div class="asdasd">
<div class="asdasd">
blabla
</div>
</div>
</div>
</div>
<div class="dsadsa"></div>
const contentNode = document.querySelector('.asdasd-1');
const output = document.querySelector('.dsadsa');
output.innerHTML = contentNode.innerHTML;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question