DEV Community

Cover image for HTML Emoji
Beginner Developer
Beginner Developer

Posted on • Originally published at beginners-developer.blogspot.com

HTML Emoji

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 😀

Top comments (2)

Collapse
 
lukeshiru profile image
Luke Shiru

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("🤯"); // "🤯"
Enter fullscreen mode Exit fullscreen mode

Cheers!

Collapse
 
beginnerdeveloper profile image
Beginner Developer

Wow nice, Thanks for sharing 😀