Last active
August 29, 2015 14:26
-
-
Save JuliaZibarieva/538e70d7ece3e117072c to your computer and use it in GitHub Desktop.
automatically delete unwanted characters
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
<input type="text" id="test" name="test" value="" size="16"> | |
<script> | |
function replace() { | |
this.value = this.value.replace(/[^0-9]+/g,'') ; | |
} ; | |
document.getElementById("test").onkeyup = replace ; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment