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.
tpatAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
cyberkiwiConnect With a Mentor Commented:
$("span:contains('UNHIDE')")
0
 
cyberkiwiConnect With a Mentor Commented:
Or exact match

$("span").filter(function() {return $(this).text() == 'UNHIDE';})
0
 
tpatAuthor Commented:
Thanks that solved it
0
 
jhp333Connect With a Mentor Commented:
This works too:
$('span[innerHTML="UNHIDE"]')
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.