Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6010257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:05:25+00:00 2026-05-23T02:05:25+00:00

I have a scenario where I need to find all <td> containing the text

  • 0

I have a scenario where I need to find all <td> containing the text “Status: Full” within a table that has been created using a javascript function.

The page <head> contains the script that generates the markup for the event calendar. This script looks like this (I have removed the rest of the events for illustration purposes):

var today = new Date();

loaded('calendarEvents', 'start', today.getFullYear(), '6', '/9#20110716 Saturday 16 July 2011. Academic Only. Status: Full/10#20110730 Saturday 30 July 2011. Academic and General Training. Status: Available/11#20110813 Saturday 13 August 2011. ');

The generated HTML for a td containing my text looks like this:

<td class="linkbg" align="center">
<b>
<span onclick="selDate = 20110625; isDate(25,5,2011,22);return false;" title=" Saturday 25 June 2011. Academic and General Training. Status: Full" style="cursor:pointer;color:#FFFFFF">25</span>
</b>
</td>

It turns out that I have to locate each <td><b><span> in this table that contains the text “Status: Full” and set the background color of that <td> to be red.

I thought that doing something like this on page load would have allowed me to find these <td>s but this is unfortunately not the case (obviously this was within a $(document).ready();:

$('td span[title*="Status: Full"]').parent().addClass("fullclass");

Can anyone shed some light on how I might achieve this?

Thanks,
Tristan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T02:05:26+00:00Added an answer on May 23, 2026 at 2:05 am

    :contains only works for text inside the element, not on attributes of the element.

    So you need to use the attribute based selectors. Try $('td span[onclick*="Status: Full"]')

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one scenario where I need to select all files having aliencoders.numeric-digits like
Scenario : I have about 14000 word documents that need to be converted from
My current scenario is that I have 20 Excel files that need to be
I have scenario where I need to host a web service (WCF) on Azure
I have a scenario where I need to load properties from database or java
I have a scenario where I need to do the following in a transaction:
I have a scenario where I need to search from many binary files (using
I have a scenario where I need a desktop console app to communicate with
I have a scenario where i need to copy the array of Objects(Main array)
In my app, I have this scenario where I need to post an object

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.