Created
January 11, 2016 11:04
-
-
Save shiftenterdev/4f976d52f2860404bdd4 to your computer and use it in GitHub Desktop.
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
$('.number').on('keyup blur',function(){ | |
var regx = /^[0-9]+$/i; | |
var input = $(this).val(); | |
if(!regx.test(input)){ | |
$('.number').val(input.replace(/[a-zA-Z]/g, '')); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment