Skip to content

Instantly share code, notes, and snippets.

@estevan-ulian
Created February 7, 2024 14:42
Show Gist options
  • Save estevan-ulian/f1ff4ecfd312c1d35d9fe837d2661dd5 to your computer and use it in GitHub Desktop.
Save estevan-ulian/f1ff4ecfd312c1d35d9fe837d2661dd5 to your computer and use it in GitHub Desktop.
Mascara para receber somente números no valor do input
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