I've been Googling and searching Stack Overflow for a while, but I can't seem to find a solution.
I have a standard HTML table with, say, fruit in it. As an example:
<table>
<tr>
<td>Apple</td>
<td>Green</td>
</tr>
<tr>
<td>Grapes</td>
<td>Green</td>
</tr>
<tr>
<td>Orange</td>
<td>Orange</td>
</tr>
</table>
Above this is a text box, into which I'd like to search the table as the user types. As a result, if they type Gre, the Orange row of the table would disappear, leaving only the Apple and Grapes. If they kept typing Green Gr, the Apple row should disappear, leaving only grapes. I hope this makes sense.
And, if the user deletes part or all of their query from the text box, I want all of the rows that now match the query to reappear.
While I know how to remove a table row in jQuery, I'm not sure how to do the search and remove rows selectively based on this. Is there a straightforward solution? Or perhaps a plugin?
It would be fantastic if someone could point me in the right direction.