Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

150
Visualizações
Javascript sorting, issue with filtering by integer

My script should be removing everything that doesn't match the value of the selected term from the drop-down list. However, it doesn't seem to be filtering at all. I'm using the exact same code for 2 other drop downs and only the term is causing issues. You can see the term is clearly present for each program on the demo page.

https://www.harpercollege.edu/dev/whoward-dev-area/open-class-list-dev.php

function detectChange5(termlist) {
   var select5 = document.getElementById('termlist');
   var keyword5 = select5.options[select5.selectedIndex].value;
   var clubDivs5 = document.getElementsByClassName('filtergroup');
   for (var f = 0; f<clubDivs5.length;f++) {
      if (clubDivs5[f].innerHTML.trim().indexOf(keyword5) === -1) {
         clubDivs5[f].style.display = "none";
      } 
      else {
            clubDivs5[f].style.display = "table-row";
      }
   }
}
<select id="termlist" onchange="detectChange5(this)">
<option value="None">Term</option>
}
<option value="202265">Spring</option>
<option value="202295">Summer</option>
<option value="202335">Fall</option>
</select>

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda