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
enclose $ in in quotes '$'
price : function( $elem ) { return parsefloat( $elem.find('.price').text().replace('$', '') ); } function x ($elem) { return parsefloat($elem.replace('$', '')); } $('.price').each(function(){ $(this).text(x($(this).text())); });
Comments
Post a Comment