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

149
Views
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
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!