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

81
Views
jQuery busca solo una columna relevante
<table> <thead> <th>Code</th> <th>Name</th> <th>barcode</th> </thead> <tbody> <tr> <td>1</td> <td>Milk</td> <td>504</td> </tr> <tr> <td>2</td> <td>Cheese</td> <td>302</td> </tr> <tr> <td>3</td> <td>Butter</td> <td>654</td> </tr> </tbody>

Arriba está la tabla que creé. Usando jQuery, quiero buscar los datos usando un th particular. Por ejemplo, quiero buscar esto usando solo el código Entonces, si ingreso 1, aparecerá el primer registro, y si quiero buscar en la tabla usando el Nombre solo cuando empiezo a escribir el nombre del registro en particular. Solo debería querer aplicar (search by the code,search by the name,search by the barcode) esas opciones. He intentado esto pero esto devolver todos los registros de cada campo, quiero buscar por un campo en particular, solo que esta es la forma en que lo intenté,

 $(document).on('keyup', '#searchProduct', function(){ var searchKey = $(this).val().toLowerCase(); $('#productTable tbody tr').each(function(){ var str = $(this).text().toLowerCase(); if(str.indexOf(searchKey) == -1){ $(this).hide(); } else { $(this).show(); } }); });
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!