Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

427
Views
filter a table, highlight and hide the content of double words

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!