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

106
Views
Establecer atributo personalizado en Js

Estoy filtrando una tabla y exportándola a Excel. Para excluir las filas filtradas, tengo que configurar data-exclude="true" en el elemento 'tr'

 function Search() { var input, filter, table, tr, td, i, txtValue; input = document.getElementById("myInput"); filter = input.value.toUpperCase(); table = document.getElementById("myTable"); tr = table.getElementsByTagName("tr"); for (i = 0; i < tr.length; i++) { td = tr[i].getElementsByTagName("td")[7]; if (td) { txtValue = td.textContent || td.innerText; if (txtValue.toUpperCase().indexOf(filter) > -1) { tr[i].style.display = "" ; //Set here the Code data-exclude="false" } else { tr[i].style.display = "none"; //Set here the Code data-exclude="true"; } } } }

``

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puede actualizar los atributos de un elemento usando la función setAttribute

tr.setAttribute('data-exclude', true)

Puede usar la función getAttribute para obtener el valor de un atributo específico. Tenga en cuenta que el valor se devuelve como una cadena y debe convertirse a un valor booleano en su caso para filtrar

about 4 years ago · Juan Pablo Isaza Report
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!