• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu
0

JQuery Selection HELP

Need to select table cells that contain date numbers 1-31 $('td:contains('5')').css("background-color", "yellow"); Above code selects cells 5 15 25 I need to select only cell that contains 5. Here is full code:https://jsfiddle.net/k9ynj3pf/1/

htmlcssjavascriptjquery
1st Apr 2018, 3:03 PM
Endri Shahini
Endri Shahini - avatar
1 Answer
+ 3
Instead of contains() try using filter(). http://api.jquery.com/filter/ https://stackoverflow.com/questions/11165618/jquery-selector-td-with-specific-text https://stackoverflow.com/questions/15364298/select-element-by-exact-match-of-its-content/18462522
1st Apr 2018, 4:42 PM
ChaoticDawg
ChaoticDawg - avatar

Often have questions like this?

Learn more efficiently, for free:

  • Introduction to Python

    7.1M learners

  • Introduction to Java

    4.7M learners

  • Introduction to C

    1.5M learners

  • Introduction to HTML

    7.5M learners

See all courses
Hot today
Can I ask question
1 Votes
I have problem understanding while loop
0 Votes
Any tips for web developer
2 Votes
Title: How do I create a clickable link in HTML? Body: I’m new to HTML and I want to create a link that takes users to another
0 Votes
JS Game?
0 Votes
No GitHub?????
1 Votes
Medal
0 Votes
Aide
0 Votes
Confused about activation account
0 Votes
What's The different Between python developer course and ( getting Start with python + python intermediate )
0 Votes