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

  • SEARCH
  • Home
  • 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 8202617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:14:55+00:00 2026-06-07T07:14:55+00:00

I tried to select all the tr’s that have id’s that contain a variable.

  • 0

I tried to select all the tr’s that have id’s that contain a variable.
It’s supposed to hide elements that don’t match as the user types into the search form.
The form has an id of #search.

$(function () {
      var content = $('#search').val();
      $('#search').keyup(function () {
          if ($('#search').text() != content) {
              content = $('#search').val();
              //content has changed, do stuff
              if (!$('tr.id:contains(content)')) {
                  $('this').hide();
              }
          }
      });
  });
  • 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-06-07T07:14:57+00:00Added an answer on June 7, 2026 at 7:14 am

    You could try this:

    $('tr[id*=' + content + ']').hide();
    

    The *= thing in an attribute match clause says to match any tag that’s got the indicated attribute with a value that contains the substring on the right, which I think is exactly what you’re asking for.

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

Sidebar

Related Questions

I'm trying to select all input elements except input type=submit/reset/button I have tried to
I'm trying to select all elements that have a data-go-to attribute that is not
I'm trying to select all the tokens that contain only letters or only letters
I want to select all posts that contain a specific tag. I'm trying it
I have tried following queries to get my facebook fan page insights data SELECT
I have tried aligning the text in the <select> element to the right or
I'm trying to select all the <input> elements of a form except ones with
I need a query that will have the date, a user's name, and one
I have Users->Orders tables (one to many) and would like to select all users
I would like to have the editor in my editable JTables select all text

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.