Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 384
  • Last Modified:

Jquery selector problem...

Hi i want to select the element on the basis of html text and hide it(in jquery),
I am not able to filter the html
eg:
<span class="hide">HIDE!</span>
<br />
<span class="hide">UNHIDE</span>
So i want to select the unhide html text and operate on it.
0
tpat
Asked:
tpat
  • 2
3 Solutions
 
cyberkiwiCommented:
$("span:contains('UNHIDE')")
0
 
cyberkiwiCommented:
Or exact match

$("span").filter(function() {return $(this).text() == 'UNHIDE';})
0
 
tpatAuthor Commented:
Thanks that solved it
0
 
jhp333Commented:
This works too:
$('span[innerHTML="UNHIDE"]')
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now