Skip to content

Tag: createtextnode

TextNode or textContent?

What’s the advantage of creating a TextNode and appending it to an HTML element over setting directly its textContent? Let’s say I have a span. And I want to change its text. What’s the advantage of using : over span.textContent = ‘hello’; Answer It ‘s not really matter of …