Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript jquery hide if html具体=£;_Javascript_Jquery_Hide - Fatal编程技术网

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();
        }
    });

谢谢,我编辑了一点,但是你的创意作品更新了我上面的条目,当它让我知道你的答案时,你的作品会标记为答案。哈哈:)我忘了父母()一点,对不起。很高兴我能帮忙。:)