Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get Unicode HEX Value of a Special Character - for use in CSS, HTML, JavaScript
// Given a special character (• in this example), open up Developer Console and write
"•".charCodeAt(0).toString(16) // "2022"
/** Use like:
*
* HTML:
* •
*
* CSS:
* .someElement:before {
* content: "\2022"
* }
*
* JS:
* someElement.textContent = "\u2022";
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment