Skip to content

Instantly share code, notes, and snippets.

@sethdavis512
Last active October 9, 2018 06:19
Show Gist options
  • Save sethdavis512/e37c86d8c43ae227b3a3ae485d341783 to your computer and use it in GitHub Desktop.
Save sethdavis512/e37c86d8c43ae227b3a3ae485d341783 to your computer and use it in GitHub Desktop.
var ageInput = document.getElementById("age")
ageInput.addEventListener("keydown", function(e) {
// prevent: "e", "=", ",", "-", "."
if ([69, 187, 188, 189, 190].includes(e.keyCode)) {
e.preventDefault();
}
})
@Tigran-Minasyan
Copy link

asaa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment