JSFiddle - React, Tailwind, and code Playground

JavaScript

var arr = ["two", "three", "four", "five", "six", "seven", "eight"];    

         $.each(arr, function (i,val) {
            alert('val is '+val+' so use that instead of "this"');
            if ($('select#select_grade_set_' + (this + 1)).val() != 'Pk-1' || $('select#select_grade_set_' + (this + 1)).val() != 'K'  || $('select#select_grade_set_' + (this + 1)).val() != '1st') {
                $('#gp_set_1').show();
                $('#gp_set_2').hide();
                $('#gp_set_3').hide();
                
                alert('pk-1');
            } else if ($('select#select_grade_set_' + (this + 1)).val() == '2nd' || $('select#select_grade_set_' + (this + 1)).val() == '3rd' || $('select#select_grade_set_' + (this + 1)).val() == '4th' || $('select#select_grade_set_' + (this + 1)).val() == '5th') {
                $('#gp_set_1').hide();
                $('#gp_set_2').show();
                $('#gp_set_3').hide();
                alert('2-5');
            } else {
                $('#gp_set_1').hide();
                $('#gp_set_2').hide();
                $('#gp_set_3').show();
                 alert('6-12');
            }

            if ($('input#number_students_set_' + (this + 1)).val() >= 120) {
                $('#gp_set_1').hide();
                $('#gp_set_2').hide();
                $('#gp_set_3').hide();
                
            } else {


            }




        });