Javascript jquery hide if html具体=£;
我有一些这样的代码Javascript jquery hide if html具体=£;,javascript,jquery,hide,Javascript,Jquery,Hide,我有一些这样的代码 if ($('.lblpricefrom > strong').html() == '£'){ $('.lblpricefrom').parents(“div.resultsitem”).hide();} 但它似乎在用类lblpricefrom隐藏项目,即使其中的html=为456 我需要它只隐藏类为lblpricefrom的项目,如果其中的html特别=just,就是这样 谢谢 杰米 更新 这很有效 $('.lblpricefrom > strong').ea
if ($('.lblpricefrom > strong').html() == '£'){
$('.lblpricefrom').parents(“div.resultsitem”).hide();}
但它似乎在用类lblpricefrom
隐藏项目,即使其中的html=为456
我需要它只隐藏类为lblpricefrom
的项目,如果其中的html特别=just
,就是这样
谢谢
杰米
更新
这很有效
$('.lblpricefrom > strong').each(
function(){
if($(this).html() == '£'){
$(this).parents("div.resultsitem").hide();
}
});
多亏了托马斯·克莱森。。。您可以这样做:
$('.lblpricefrom > strong').each(
function(){
if($(this).html() == '₤'){
$(this).hide();
}
});
谢谢,我编辑了一点,但是你的创意作品更新了我上面的条目,当它让我知道你的答案时,你的作品会标记为答案。哈哈:)我忘了父母()一点,对不起。很高兴我能帮忙。:)