The Wayback Machine - https://web.archive.org/web/20210811194343/https://dev.to/beginnerdeveloper/html-emoji-95p

DEV Community

DEV Community is a community of 679,575 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create new account Log in
loading...
Cover image for HTML Emoji

HTML Emoji

Beginner Developer
Hello! I am Muhammad Ejaaz Razzak Khan, a Software Developer.
Originally published at beginners-developer.blogspot.com ・1 min read

Emojis are characters from the UTF-8 alphabet.

Emojis are characters, they can be copied, displayed, and sized just like any other character in HTML.

HTML Emoji Code Output:
Emoji Output
Preview:

Emoji Value
⌚
⌛
❌
🗾 🗾
🗿 🗿
😀 😀
😁 😁
😂 😂
😃 😃
😄 😄
😅 😅

For a full list:- HTML Emoji Reference.

Checkout My Blog 😀

Discussion (1)

lukeshiru profile image
LUKE知る

Here's a JS function you might find useful (I wrote it a few days ago). It turn emoji into the HTML escaped version:

/** @param {string} string */
const htmlEscape = string =>
    [...string]
        .map(char => {
            const code = char.codePointAt(0);
            return code > 127 ? `&#${code};` : char;
        })
        .join("");

htmlEscape("💃🏻"); // "💃🏻"
htmlEscape("🤯"); // "🤯"

Cheers!