Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/serhii-chernenko/javascript-input-validating-emoji
- Owner: serhii-chernenko
- License: mit
- Created: 2023-04-27T10:14:50.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-27T10:20:48.000Z (almost 2 years ago)
- Last Synced: 2024-11-14T04:29:39.986Z (2 months ago)
- Topics: emoji, html, input, javascript, validation
- Language: JavaScript
- Homepage: https://codepen.io/inevix/pen/VwEWYoY
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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/