Created
March 1, 2018 03:49
-
-
Save aa6my/ee3e2ad2ae3c41e1d6d95d9489d40d97 to your computer and use it in GitHub Desktop.
REGEX
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
$('#testing').keydown(function(e) { | |
if (e.keyCode === 190) { | |
e.preventDefault(); | |
} | |
}); | |
$('#testing').on('input propertychange paste', function (e) { | |
var reg = /^[1-9]+/gi; | |
if (this.value.match(reg)) { | |
this.value = this.value.replace(reg, ''); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment