So I've got a span
<span class="delete-btn">✘</span>
and am trying to include the HTML unicode for x - ✘ within a textNode -
span.appendChild(document.createTextNode("✘"));
however this simply isn't working. Any ideas?
You can simply use \u2718 :
let span = document.getElementsByClassName('delete-btn')[0];
span.appendChild(document.createTextNode('\u2718'));
<span class="delete-btn">✘</span>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With