Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Jquery selector problem...

Posted on 2010-08-18
4
Medium Priority
?
383 Views
Last Modified: 2013-11-11
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
Comment
Question by:tpat
  • 2
4 Comments
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 1336 total points
ID: 33470750
$("span:contains('UNHIDE')")
0
 
LVL 58

Assisted Solution

by:cyberkiwi
cyberkiwi earned 1336 total points
ID: 33470775
Or exact match

$("span").filter(function() {return $(this).text() == 'UNHIDE';})
0
 

Author Comment

by:tpat
ID: 33472058
Thanks that solved it
0
 
LVL 7

Assisted Solution

by:jhp333
jhp333 earned 664 total points
ID: 33472205
This works too:
$('span[innerHTML="UNHIDE"]')
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Introduction to Processes

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question