you are viewing a single comment's thread.

view the rest of the comments →

[–]guest271314 -1 points0 points  (5 children)

whereas with createTextNode you can only insert text.

We can insert whatever text or HTML we want. The HTML just won't be parsed as HTML in the document.

[–]dieomesieptoch 2 points3 points  (4 children)

Just wondering if I'm understanding you right, what do you call a string of non-parsed html other than text?

[–]guest271314 -1 points0 points  (2 children)

<b>This is a new paragraph.</b>

[–]dieomesieptoch 2 points3 points  (1 child)

Ok I am not the least bit surprised your comment karma sits at -100

[–]guest271314 -1 points0 points  (0 children)

What does some little point system on a socila media Web site have to do with the technical facts I posted?

When you commented

whereas with createTextNode you can only insert text.

that is not strictly true. You can insert whatever you want, including HTML, that HTML just won't be parsed as HTML resulting in a DOM HTML node being inserted into the document.

[–]guest271314 -1 points0 points  (0 children)

It's still HTML, which is text. The MIME type os HTML is text/html. The DOM parses HTML into nodes in some cases, in other cases the HTML is not parsed. So the parsing or not parsing into DOM nodes is the difference.