I have an element in javascript like follows:
280ms
I want to extract 280 from the span element. How can I do it?
in general for numbers no mather negative or positive
blah blah 285blahblah var html= document.getElementsByTagName('div')[0].innerHTML;// or $('div').html() if jquery var number = parseFloat(html.match(/-*[0-9]+/));
http://jsfiddle.net/R55mx/