title: Jquery : Change Dropdown value on change event
body: <p>I have a dropdown like this:</p>
  
  <pre><code>&lt;div class="form-group"&gt;
       &lt;select class="form-control" id="class" name="class"&gt;
           &lt;option value="grade"&gt;Grade&lt;/option&gt;
           &lt;option value="year"&gt;Year&lt;/option&gt;
       &lt;/select&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>And there is another drop-down next to it: </p>
  
  <pre><code>&lt;div class="form-group"&gt;
       &lt;select class="form-control" id="class_year" name="class_year"  &gt;
           &lt;option value="3"&gt;3&lt;/option&gt;
           &lt;option value="4"&gt;4&lt;/option&gt;
           &lt;option value="5"&gt;5&lt;/option&gt;
           &lt;option value="6"&gt;6&lt;/option&gt;
           &lt;option value="7"&gt;7&lt;/option&gt;
           &lt;option value="8"&gt;8&lt;/option 
       &lt;/select&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>if in first dropdown grade is selected, the second dropdown should start from 3 otherwise it should start from 5. I tried using <code>on('change'function(){})</code>but could not manipulate values, Please help me with this.</p>
  
  <p>Here I want to change the value:</p>
  
  <pre><code> $("#class").on('change',function(){
              if(this.value=='grade'){ 
                  // here  i have to set the value, if its grade it will start from 4 otherwise it will  be 3 
              }
          })
  </code></pre>