Help with hiding DIV tags, based on text content, using Greasemonkey

允我心安 提交于 2019-12-06 03:53:50

Here's a script that does that, using jQuery. The hard part is choosing the selectors.

// ==UserScript==
// @name     Show State1 passes only.
// @include  http://YOUR_SITE/YOUR_PATH/*
// @require  http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
// ==/UserScript==

$("div.A")  .hide ()
            .has ("span.sc1:contains('passtest')")
            .has ("em.ec1:contains('State1')")
            .show ();

Note that :contains() is case-sensitive.

See the code in action at jsFiddle.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!