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

94
Views
Agregue resaltador a una búsqueda / filtro de tabla Javascript

Tengo este javascript que busca todos los campos en una tabla html, para un texto de entrada, luego muestra las filas que coinciden y oculta las que no. Quiero resaltar aún más la cadena de búsqueda en las filas mostradas. Cómo hacerlo de una manera simple cambiando este script:

 <script> function myFunction(){ // Declare variables var input, filter, table, tr, td, i; input = document.getElementById("myInput"); filter = input.value.toUpperCase(); table = document.getElementById("myTable"); tr = table.getElementsByTagName("tr"); // Loop through all table rows, and hide those who do not match the search query for (i = 1; i < tr.length; i++) { td = tr[i].getElementsByTagName("td") ; for(j=0 ; j<td.length ; j++) { var tdata = td[j] ; if (tdata) { if (tdata.innerHTML.toUpperCase().indexOf(filter) > -1) { tr[i].style.display = ""; break ; } else { tr[i].style.display = "none"; } } } } } </script>

Además, aquí hay un archivo de tabla html de muestra con este javascript incrustado en la parte superior: https://sourceforge.net/projects/my-project-files/files/marks.html/download

Por favor, ayúdenme con el script revisado y probado. Soy un novato en javascript. Gracias.

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!