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

objective c - Can't build GCM with Protobuf in Xcode -

ember.js - EmberJS Model find not up-to-date with underlying store -

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