I have a table, and I would like to filter a row that is not selected from multiple selection.
<table id="myTable">
<tr>
<td>Working Visa</td>
<td>Blond</td>
</tr>
<tr>
<td>Student Visa</td>
<td>Brown</td>
</tr>
</table>
I would like, when I select (or deselect) values โโfrom one of them, it filters the rows where no values โโare selected.
<select class="select" multiple>
<option value="Working Visa"></option>
<option value="Student Visa"></option>
</select>
<select class="select" multiple>
<option value="Blond"></option>
<option value="Brown"></option>
</select>
What have i done so far
$("select.select").change( function() {
$(this).each(function() {
var valeurs = $(this).val();
$("#MyTable tr").show();
$("td").not("td."+valeurs).parent("tr").hide();
});
});
When you click on "Work Visa", I want to show only lines with a "work visa". But if I click on the blonde too, they will show a line with a work visa and a blonde.
source
share