Dependent Select Jquery,JavaScript.. How can i change a select value when the length of other select is MAX?

enter image description here

So i need to change the school when the length of CLASS is max, which is 3, everytime CLASS select is 3 i'm gonna have to change to the next value from SCHOOL select, how do i do this?