jQuery how to get number from string? -


i have html:

<span class="price-old" style="padding: 2px;">179,00 dkk</span> 

or be:

<span class="price-old" style="padding: 2px;">1.750,00 dkk</span> 

how number?

try this:

parseint($('.price-old').text().replace(/[^0-9.]/g, ""));  //<-- remove parseint() include value after decimal point 

demo


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -