how to remove numbers from a string in javascript code example Example: javascript remove all but numbers string.replace(/[^0-9]/g, '');