Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

195
Views
How do I find a span with a specific class that contains an exact string of text?

I'm trying to find the following node within a page:

<span class="dotted">Admin</span>

I've tried the following jQuery selectors, but neither seem to work in selecting the node:

$(".dotted span:contains('Admin')").css("color","red");
$("span:contains('Admin') .dotted").css("color","red");

What am I doing wrong?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

This selector should do what you want.

$("span.dotted:contains('Admin')")

Remember you can chain Tag names with IDs and classes. Example

$("span#yourID")

OR

$("span.yourclass")

OR a mixture of the two

$("span#yourID.yourClass")
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!