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

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -