


help make sure that when you click New Question, the Question block is copied below JS HTML



help make sure that when you click New Question, the Question block is copied below JS HTML
document.querySelector('button').addEventListener('click', () => { var ddd = document.querySelector('.qqq').cloneNode(true); document.body.insertBefore(ddd, document.querySelector('button')); }) * { margin: 0; padding: 0; } html, body { width: 100%; height: 100%; background: #272727; } div { color: white } <div class="qqq"><input type="text" placeholder="Имя"><input type="text" placeholder="фамилия"></div> <button>добавить</button> Source: https://ru.stackoverflow.com/questions/737287/
All Articles