const clone=document.querySelector('.ainfo').cloneNode(true); [].forEach.call(clone.querySelectorAll('p,a'),function(node){ node.parentNode.removeChild(node); }); document.body.appendChild(clone);