Solved

Jquery selector problem...

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
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…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

751 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