Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

428
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda