d.toString(16)

Beautifully simple way to get a hex value from a number. Note that d is a number. If you want a string as a hex XML valid code, use:

'&#x' + parseInt(number).toString(16).toUpperCase() + ';'

UK EVENTAttend ffconf.org 2024

The conference for people who are passionate about the web. 8 amazing speakers with real human interaction and content you can't just read in a blog post or watch on a tiktok!