Solved

Jquery selector problem...

Posted on 2010-08-18
4
381 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
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…
Starting up a Project

623 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