I have a question ! I'm trying to create a filter in a table with mark.js, where found words are highlighted and non-highlighted content is hidden, so far so good this is the code:
$(function() {
var $input = $("input[name='test']")
$context = $("table tbody tr");
$input.on("input", function() {
var term = $("#test").val();
$context.show().unmark();
if (term) {
$context.mark(term, {
done: function() {
$context.not(":has(mark)").hide();
}
});
}
});
});
the problem arises when I want to search for more words on the same line, the code will find the matches searched for type OR, while I would like to filter the search type AND and exclude all the other lines that do not have the double match. How could I solve in your opinion?
this is what I need: jsfiddle.net/julmot/buh9h2r8/
adapting it to the code above, also because I would like to create a checkbox that allows me to search both type OR and type AND!
Thanks for your help