How to implement emoji in textarea similar to gmail and facebook

How would I go about this? Are they images?
How can I make it so that when the user types ':D' it turns into a face emoji?

A general explanation would be great. I have no idea how you can put images in textareas.

Answers 1

  • Emojis are just unicode, not images, so they can be used as text. To change their look, use a different font:

    Extracted from http://www.businessinsider.com/unicode-emoji-chart-2015-12

    Extracted from http://www.businessinsider.com/unicode-emoji-chart-2015-12


    But they aren't on (fisical) keyboards, so what some services do is to put a lot of buttons with their corresponding emoji so you can type them easily.

    But what YounesM said is also true:

    ... you could simply have a script that look for ' :D ' and replace it by ????

    Other services, instead of filling a div with buttons, run a script when you create or edit a post/question/answer/comment/other for replacing specific substrings with emoji.


Related Articles