Last active
May 30, 2018 08:27
-
-
Save suebphatt/5c37b2c472ac5ebe0b6eb3f3797a9bc0 to your computer and use it in GitHub Desktop.
ENGLISH ONLY JS -- OnKeyup english only input type=text, also works on mobile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -- english only | |
$(".english-only").on('keyup change', function(event){ | |
var sanitized = $(this).val().toString().replace(/[^\u0000-\u007F]+/, ''); | |
$(this).val(sanitized); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment