views:

19

answers:

1

I have some code like this

if ($('.lblpricefrom > strong').html() == '£'){

$('.lblpricefrom').parents("div.resultsitem").hide();}

But it seems to be hiding items with the class lblpricefrom even if the html within = £456

I need it to only hide the items with the class lblpricefrom if the html within specifically = just £ and thats it

Thanks

Jamie

UPDATE

this works

$('.lblpricefrom > strong').each(
function(){
    if($(this).html() == '£'){
        $(this).parents("div.resultsitem").hide();
    }
});

Thanks to Thomas Clayson

+1  A: 

hmm... you could do this:

$('.lblpricefrom > strong').each(
    function(){
        if($(this).html() == '₤'){
            $(this).hide();
        }
    });
Thomas Clayson
Thanks I edited a bit but your idea works updated my entry above with what worked will mark yours as answer when it lets me lol
Jamie Taylor
Haha :) I forgot the parents() bit, sorry. Glad I could help. :)
Thomas Clayson