htmlspecialcharscreatetextnode

Creating a textNode, but using character entity references


I tried creating a text node with character entity references. (In JavaScript) I was not successful. Question: How would I create a text node with special characters?


Solution

  • You should use the unicode value notation: document.createTextNode("\uf012");