Consider a non-DOM scenario where you\'d want to remove all non-numeric characters from a string using JavaScript/ECMAScript. Any characters that are in range 0 - 9
0 - 9
Use the string's .replace method with a regex of \D, which is a shorthand character class that matches all non-digits:
\D
myString = myString.replace(/\D/g,'');