1
2// Html: <span id="foo">280ms</span>
3
4var text = $('#foo').text();
5var number = parseInt(text, 10);
6alert(number);
7
8// parseInt('ms120'.replace(/[^0-9\.]/g, ''), 10);
1var regex = /\d+/g;
2var string = "Any string you want!";
3var matches = string.match(regex); // creates array from matches
4
5if (matches){
6 // There is a digit in the string.
7} else {
8 // No Digits found in the string.
9}