Search code examples
javascriptjquerydingbats

UTF8 Dingbats + Javascript


Is there a way to set the text of an element to something like ✘ (✘) using JQuery?

ie:

$('#something').text('`✔`'); //only ends in tears.

Solution

  • String.fromCharCode is the tool you need.

    $('#something').text(String.fromCharCode(10004)); //Checkmark