string - jQuery isotope sort price -


i'm not having luck in getting correct sorts pricing belive $ sign interfering cannot replace function work.

my html

<span class="field-content price">$486.15</span> 

my jquery function

price : function( $elem ) {         return parsefloat( $elem.find('.price').text().replace($, '') );       } 

for reason not seem removing $ sign. missing in function?

im not sure if decimal point causing problems sort

thanks in advance

demo

enclose $ in in quotes '$'

price : function( $elem ) {         return parsefloat( $elem.find('.price').text().replace('$', '') );       } 

demo

function x ($elem) {     return parsefloat($elem.replace('$', '')); } $('.price').each(function(){      $(this).text(x($(this).text())); }); 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -