If you need to strip all non-numeric characters from a string (except for the period character) using JavaScript, try:

string.replace(/[^\d.]/g, "");