If i have a table:
<table id="myTable">
<tr>
<td>1</td><td>2</td><td>NoMatch</td><td>4</td>
</tr>
<tr>
<td>1</td><td>2</td><td>Match</td><td>4</td>
</tr>
</table>
I have been trying:
$(document).ready(function () {
$('input#myInput').keyup(function (val) {
// for each third td of each row, if this value does not contain: this.val() then hide it
});
});
Something like this:
I assumed that when you say contains, you mean that the text has to be equal to the provided input (otherwise
NoMatchandMatchwould not make sense). But if the content of cell just has to contain the search string as substring, you can use.indexOf()[docs].DEMO
There are other things you have to consider, like what should happen when the search string is empty, but this is for you to play around 😉