Solved

Jquery selector problem...

Posted on 2010-08-18
4
375 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This is an explanation of a simple data model to help parse a JSON feed
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now