Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/serhii-chernenko/javascript-input-validating-emoji

Prevent inserting emoji to an HTML input element and validate the input in JavaScript
https://github.com/serhii-chernenko/javascript-input-validating-emoji

emoji html input javascript validation

Last synced: 13 days ago
JSON representation

Prevent inserting emoji to an HTML input element and validate the input in JavaScript

Awesome Lists containing this project

README

        

# Validate emoji in HTML input by JavaScript
Prevent inserting emoji to an HTML input element and validate the input in JavaScript
```javascript
/[\p{Extended_Pictographic}\u{1F3FB}-\u{1F3FF}\u{1F9B0}-\u{1F9B3}]/gu
```


# Source

- [GitHub](https://github.com/Inevix/javascript-input-validating-emoji/blob/main/index.js)
- [CodePen](https://codepen.io/inevix/pen/VwEWYoY)

# Useful links

- https://unicode.org/reports/tr51/#Emoji_Properties
- https://stackoverflow.com/questions/18862256/how-to-detect-emoji-using-javascript
- https://stackoverflow.com/questions/64389323/why-do-unicode-emoji-property-escapes-match-numbers

# Open-sourced repo

- https://github.com/milesj/emojibase
- https://emojibase.dev/