Solved

Jquery selector problem...

Posted on 2010-08-18
4
377 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 334 total points
ID: 33470750
$("span:contains('UNHIDE')")
0
 
LVL 58

Assisted Solution

by:cyberkiwi
cyberkiwi earned 334 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 166 total points
ID: 33472205
This works too:
$('span[innerHTML="UNHIDE"]')
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

This is an explanation of a simple data model to help parse a JSON feed
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The viewer will learn how to dynamically set the form action using jQuery.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

777 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