title: How do I disable multiple options in multiple select tags with JavaScript?
body: <p>I have a page with multiple dropdowns and I want to disable multiple options in all of those dropdowns.</p>
  
  <p>The options I aim to disable share certain characteristics, namely that they're identified with two classes each. Many of the options in all the lists share the same classes and I want to add several buttons that enable or disable options based on those classes.</p>
  
  <p>My issue is, that the standard ways I have seen here target options </p>
  
  <ol>
  <li>by select element </li>
  <li>by number.</li>
  </ol>
  
  <p>But mine are dynamically generated and the options that I'm trying to disable are not always next to each other. </p>
  
  <p>Here's a snippet of one of the dropdowns:</p>
  
  <pre><code>&lt;select name="m1"&gt;
      &lt;option value="Abyss Guard, Cereberus" class="Covert Beast"&gt;Abyss Guard, Cereberus&lt;/option&gt;
      &lt;option value="Abyss Guard, Cereberus+" class="Covert Beast"&gt;Abyss Guard, Cereberus+&lt;/option&gt;
      &lt;option value="Achlis+" class="Covert Beast"&gt;Achlis+&lt;/option&gt;
      &lt;option value="Adept Devil+" class="Impulse Demon"&gt;Adept Devil+&lt;/option&gt;
      &lt;option value="Agares+" class="Covert Demon"&gt;Agares+&lt;/option&gt;
      &lt;option value="Airship of Death+" class="Psycho Creation"&gt;Airship of Death+&lt;/option&gt;
      &lt;option value="Ancient Huge Statue+" class="Psycho Creation"&gt;Ancient Huge Statue+&lt;/option&gt;
      &lt;option value="Anna Thorn Maiden" class="Impulse Demon"&gt;Anna Thorn Maiden&lt;/option&gt;
      &lt;option value="Anna Thorn Maiden+" class="Impulse Demon"&gt;Anna Thorn Maiden+&lt;/option&gt;
      &lt;option value="Anomalocaris+" class="Impulse Beast"&gt;Anomalocaris+&lt;/option&gt;
      &lt;option value="Apopisu of Chaos+" class="Psycho Beast"&gt;Apopisu of Chaos+&lt;/option&gt;
      &lt;option value="Arachno Chi" class="Psycho Crawler"&gt;Arachno Chi&lt;/option&gt;
      &lt;option value="Arachno Chi+" class="Psycho Crawler"&gt;Arachno Chi+&lt;/option&gt;
      &lt;option value="Arbitration Demon+" class="Psycho Demon"&gt;Arbitration Demon+&lt;/option&gt;
      &lt;option value="Armored Black Tiger+" class="Impulse Beast"&gt;Armored Black Tiger+&lt;/option&gt;
      &lt;option value="Armored Bucephalus+" class="Covert Beast"&gt;Armored Bucephalus+&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>This is by no means an exhaustive list, there's a couple of hundred options for each dropdown, though all the dropdowns contain the same list. As you can see, the list is sorted alphabetically, not by class.</p>
  
  <p>I am looking to disable and enable options with a button based on one of the two classes, and a disabled status should override an enabled status. The standard <code>document.getElementById('m1').options[number].disabled</code> doesn't really help me here as the list is dynamically generated and I do not know where a specific option will end up.</p>
  
  <p>Part of the site's aim is to minimize the amount of reloading needed and at the same time minimize the amount of javascript being executed, to speed up responsiveness. Is there a way I can select all options in all of the dropdowns that are of any specific class?</p>