Last active
October 9, 2018 06:19
-
-
Save sethdavis512/e37c86d8c43ae227b3a3ae485d341783 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var ageInput = document.getElementById("age") | |
ageInput.addEventListener("keydown", function(e) { | |
// prevent: "e", "=", ",", "-", "." | |
if ([69, 187, 188, 189, 190].includes(e.keyCode)) { | |
e.preventDefault(); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
asaa