3 ms·
My point was that having to escape things like open close tags, ampersands etc looks horrible and ugly. HTML entities inside HTML code inside strings isn't some
by axod 18y ago
My point was that having to escape things like open close tags, ampersands etc looks horrible and ugly. HTML entities inside HTML code inside strings isn't something I enjoy looking at.
(My example code shows some HTML code as plain text, which needs htmlEntities when using innerHTML).
You can't put anything in nodeValue apart from a string value. But the good thing is, it's just a string. No security issues, no entity encoding, no html tag issues.
- willwagner 18y agoI see your point; I misread it first time around. From a security point of view for user content, nodeValue is a much better approach.