title: Remove options by id from depending dropdown?
body: <p>I'm trying to ged rid of some options in a dropdown (selectB) depending on the selection chosen in another dropdown (selectA).
  Unfortunately my solution doesn'n work. Does anyone have a hint?
  a132 is an option given in the first dropdown. If this option is being chosen the options b01 and b03 should be removed from the second dropdown. getridofoptions() is called onChange. bo2, bo4, b05 and b06 should stay in the dropdown. If the user alters the selection in the first dropdown, all possible options should be reactivated (don't have a glue how to do so). After this the getridofoptions should remove the options according to the new selection.
  Example: If selectA is bening changed from a132 to a133 the options b01, b02 und b04 should be kicked of and b03, b05, b06 should stay.
  Tankful for any support/ideas Georg</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function getridofoptions() {
    if (document.getElementById('a132').selected == True) {
      var x = document.getElementById("b01");
      x.remove(x.selectedIndex);
      var x = document.getElementById("b02");
      x.remove(x.selectedIndex);
      var x = document.getElementById("b04");
      x.remove(x.selectedIndex);
    } else {}
    if (document.getElementById('a133').selected == True) {
      var x = document.getElementById("b01");
      x.remove(x.selectedIndex);
      var x = document.getElementById("b03");
      x.remove(x.selectedIndex);
    } else {}
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;select id="selectA" name="Size" onchange="ReadForm (this.form, false);getridofoptions();"&gt;
    &lt;option value="" id="a00" selected&gt;1. W&amp;auml;hlen Sie Ihre Variante&lt;/option&gt;
    &lt;option value="a &amp;szlig alabla" id="a130"&gt;wei&amp;szlig; 5,00 EUR&lt;/option&gt;
    &lt;option value="b &amp;szlig blabla" id="a131"&gt;wei&amp;szlig; 6,00 EUR&lt;/option&gt;
    &lt;option value="c &amp;szlig clabla" id="a132"&gt;wei&amp;szlig; 7,00 EUR&lt;/option&gt;
    &lt;option value="d &amp;szlig dlabla" id="a133"&gt;wei&amp;szlig; 8,00 EUR&lt;/option&gt;
    &lt;option value="e &amp;szlig eabla" id="a134"&gt;wei&amp;szlig; 9,00 EUR&lt;/option&gt;
  &lt;/select&gt;
  
  &lt;br&gt;
  &lt;select id="selectB" name="Options" onchange="ReadForm (this.form, false);getridofoptions();"&gt;
    &lt;option value="" id="b99" selected&gt;2. W&amp;auml;hlen Sie aus:&lt;/option&gt;
    &lt;option value="Test ha" id="b01"&gt;Test ha&lt;/option&gt;
    &lt;option value="Test ho" id="b02"&gt;Test ho&lt;/option&gt;
    &lt;option value="Test hk" id="b03"&gt;Test hk&lt;/option&gt;
    &lt;option value="Test kl" id="b04"&gt;Testreihe kl&lt;/option&gt;
    &lt;option value="Test km" id="b05"&gt;Testreihe km&lt;/option&gt;
    &lt;option value="Test lo" id="b06"&gt;Testreihe lo&lt;/option&gt;
  &lt;/select&gt;</code></pre>
  </div>
  </div>
  </p>