Created
February 7, 2024 14:42
-
-
Save estevan-ulian/f1ff4ecfd312c1d35d9fe837d2661dd5 to your computer and use it in GitHub Desktop.
Mascara para receber somente números no valor do input
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
function onlyNumbersMask (event) { | |
let value = event.target.value; | |
let mask = ''; | |
mask = value.replace(/\D/g, ''); | |
event.target.value = mask; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment