Handle Unicode text, emoji, encoding, normalization, code points, and safe storage.
Lessons
Add an emoji selector to an input.
Building an Emoji Picker is easiest to learn by reading the example, changing it, and observing the result.
// A tiny emoji picker
const emojis = ['😀', '🎉', '🚀', '❤️', '👍', '🔥'];
const picker = document.querySelector('#picker');
picker.innerHTML = emojis
.map(e => `<button type="button" aria-label="emoji">${e}</button>`)
.join('');
picker.addEventListener('click', e => {
if (e.target.tagName === 'BUTTON') {
document.querySelector('#input').value += e.target.textContent;
}
});Practice the Building an Emoji Picker example in a small scratch file, then explain what changed and why.