title: Dynamic change max values in select with javascript
body: <p>I have 2 selects like this:</p>
  
  <pre><code>&lt;select id='select1'&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;/select&gt;
  
  
  &lt;select id='select2'&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;/select&gt;
  
  
  
  &lt;select id='select3'&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;/select&gt;
  </code></pre>
  
  <p>In this example, 5 is a max so if I select the value 2 in select1, I want my select2 and select3 to have as max value : <strong>5 - 2 = 3</strong> to get this final output:</p>
  
  <pre><code>&lt;select id='select2'&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;/select&gt;
  
  &lt;select id='select3'&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;/select&gt;
  </code></pre>
  
  <p>Of course, the behaviour should be the same regardless of the items I choose.</p>