How to insert HTML entities with createTextNode?

You can’t create nodes with HTML entities. Your alternatives would be to use unicode values

var dropdownTriggerText = document.createTextNode('blabla \u0026');

or set innerHTML of the element. You can of course directly input &

Leave a Comment