• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 512
  • Last Modified:

how to find a string in html table using jquery

I am generating an html table which has 3 columns and on the top of this table I have one textbox and then a dropdown which contains the  name of 3 columns.

now i want to search a string in the html table which user type in the selected column( using the dropdown).
using jquery.

how can i do this.
1 Solution
Using jQuery, you need to do a search through the <td> tags most likely.

var whatYouAreSearchingFor = 'Test';
$("#tableId, td:contains(whatYouAreSearchingFor)")... do what you need to do.

This would search through the TD tags of a table with the ID = 'tableID' looking for the text in whatYouAreSearchingFor.

I hope this is helpful.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now