I am having a little trouble in jQuery.
$(document).on('change', '.filter-status, .filter-week', function() {
var filter = [];
filter.push({
week: $('.filter-week').val(),
status: $('.filter-status').val(),
})
//filter.week('week', $('.filter-week').val());
filter.status = $('.filter-status').val();
var tags = [];
//console.log(filter);
$.each(filter, function(index, value) {
if (value != 'all') {
tags.push(value);
}
});
});
I have a table row that looks as follows:
<tr>
<td>1</td>
<td>Some text...
<td>
<button class="tag" data-tag="1234"></button>
<button class="tag" data-tag="1235"></button>
</td>
</tr>
<tr>
<td>2</td>
<td>Some text...
<td>
<button class="tag" data-tag="1234"></button>
</td>
</tr>
What I am trying to do is to hide a tr that does not contain tag 1234 and 1235.
Edit
To be a bit more clear.
The tags object contains id 1234 and 1235. I want to hide all table rows that do not have both these tags. So if a table row only has 1234 it should be hidden. If it has only 1235 it should be hidden as well. If it has both 1234 and 1235 it should NOT be hidden.