I found the answer. Insert HTML element two (or more) times using JavaScript
But I need in depth knowledge about this. How does this happened without for loop or cloning?
let strong = document.createElement('strong');
let text = document.createTextNode('text');
strong.appendChild(text);
let p = document.querySelector('p')
p.appendChild(strong);
// let anotherText = document.createTextNode('anotherText');
// document.querySelector('strong').appendChild(anotherText)
document.querySelector('strong').appendChild(text);
if you uncomment lines then anotherText
gets added to strong tag.
Why the last one is not working?
There is some reference or what?