2010-09-13 54 views
0

我有这样jQuery的隐藏的HTML专门=£

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

$一些代码( 'lblpricefrom。')父母( “div.resultsitem”)隐藏();}

但这似乎是隐藏与类lblpricefrom即使中的HTML = £456

我就只需要隐藏与类lblpricefrom的项目,如果内特别是HTML =只是£和多数民众赞成

项目

感谢

杰米

UPDATE

这个作品

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

感谢Thomas Clayson

回答

1

嗯......你可以这样做:

$('.lblpricefrom > strong').each(
    function(){ 
     if($(this).html() == '₤'){ 
      $(this).hide(); 
     } 
    }); 
+0

谢谢我编辑了一下,但你的想法工程更新了我的条目上面用什么工作将它标记为答案,当它让我大声笑 – 2010-09-13 10:46:30

+0

哈哈:)我忘了父母()位,对不起。很高兴我能帮上忙。 :) – 2010-09-13 10:48:48