title: Handling select box values using HTML jQuery
body: <p>I have a code like this.</p>
  
  <p>HTML:</p>
  
  <pre><code>    &lt;select id="from_value"&gt;
      &lt;option value="1"&gt;1&lt;/option&gt;
      &lt;option value="2"&gt;2&lt;/option&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&gt;
      &lt;option value="9"&gt;9&lt;/option&gt;
      &lt;option value="10"&gt;10&lt;/option&gt;
      &lt;/select&gt;
      &lt;select id="to_value"&gt;
      &lt;option value="1"&gt;1&lt;/option&gt;
      &lt;option value="2"&gt;2&lt;/option&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&gt;
      &lt;option value="9"&gt;9&lt;/option&gt;
      &lt;option value="10"&gt;10&lt;/option&gt;
      &lt;/select&gt;
  </code></pre>
  
  <p>JQuery:</p>
  
  <pre><code>    $("#from_value").change(function () {
      var val = +this.value;
      $("#to_value option").hide();
      $("#to_value option:gt(" + val + "),#to_value option:eq(" + val + ")").show();
      $("#to_value").val(val);
      });     
  </code></pre>
  
  <p>The code is shared in jsfiddle for easy editing. <a href="http://jsfiddle.net/fuub1wrd/1/" rel="nofollow">http://jsfiddle.net/fuub1wrd/1/</a></p>
  
  <p>When the from value is changed, the to value is getting changed based on from_value event.</p>
  
  <p>Now, what I'm trying to do is.</p>
  
  <p>If the <code>from_value</code> is <code>5</code>, then the <code>to_value</code> should display <code>5,6,7,8</code> only (only four values from the selected value)</p>
  
  <p>In other words, display only four values with respect to the from_value.
  If <code>from_value</code> is <code>6</code>, then in <code>to_values</code> i should be able to see only <code>6,7,8,9</code></p>
  
  <p>How can I achieve that? I know this is bit easy, but still, I'm sitting with my code.</p>
  
  <p>Thanks,
  Kimz</p>