SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    Body
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    JQuery - Hide table rows that contain specific HTML in a cell?

    How can I use jquery to cycle through all the table rows I have in a table, and hide the rows that contain a specific HTML value that I pass to jquery?

    For instance, I have a table full of students, and courses each student is taking. If I want to hide all the rows where the course is Chemistry (regardless of student), how would I do that?

    I already have captured the HTML value, what I mainly need help with is how to tell jquery to hide ALL of the rows with that HTML value, rather than just the row I click on.

    Thanks in advance!

  2. #2
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    Body
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Figured this out... originally I was trying to look through all the table rows, but then I tried this and it worked:

    var hide_me = $("tr:contains("+hide_value+")");
    hide_me.hide();

    Thanks!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •