I have an input field that gets a value. I would like to remove letters and special characters from the value of this input, leaving only numbers remaining. I think it would be easier to use a replace with a regular expression, but I can not. Could someone help me?
I've tried it like this:
valor.replace(/\d|,/g, "");
It just does not do anything.