隐藏包含小于阈值的数字的子文本的元素

时间:2015-06-26 05:48:54

标签: javascript jquery greasemonkey tampermonkey

我正在努力让这项工作在亚马逊的100条评论中隐藏物品。我不知道自己做错了什么。我使用TamperMonkey / GreaseMonkey插件/扩展。我应该从搜索中添加这些项目,然后选择类别,如果您尝试复制它,如果这会产生影响。

$('LI.s-result-item SPAN + A')
    .filter( function(){ return parseInt($(this).text())<100; } )
    .parent().css({ "opacity": "0.25" });

我想隐藏的项目的屏幕截图: screenshot

1 个答案:

答案 0 :(得分:0)

.yellowBackground { background-color: yellow; } .redBackground { background-color: red; }无法解析数字中的分组逗号,因此请先删除它们:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<button id="button" class="yellowBackground">paina tästä</button>

P.S。 regexp用于处理超过一百万条评论的项目(好吧,可能会发生)。