cloneNode
<script type="text/javascript">
window.onload = function () {
var botaoFalse, botaoTrue, container, para, cloneFalse, cloneTrue;
botaoFalse = document.getElementById("btnf");
botaoTrue = document.getElementById("btnt");
container = document.getElementById("container");
para = document.getElementsByTagName("p")[0];
cloneFalse = para.cloneNode(false);
cloneTrue = para.cloneNode(true);
botaoFalse.onclick = function() {
container.appendChild(cloneFalse);
}
botaoTrue.onclick = function() {
container.appendChild(cloneTrue);
}
}
<script>
... <p class="xpto">Texto do parágrafo com <b>palavra</b> em negrito.</p> <button type="button" id="btnf">cloneNode(false)</button> <button type="button" id="btnt">cloneNode(true)</button> ...
Texto do parágrafo com palavra em negrito.