title: ASP.NET MVC Razor Getting select option value
body: <p>Here's my code. Excuse me if I explain this wrong.</p>
  
  <pre><code>&lt;select class="form-control" data-val="true" data-val-number="The field 
  SupervisorID must be a number." data-val-required="The SupervisorID field is 
  required." id="SupervisorID" name="SupervisorID"&gt;&lt;option value="" 
  disabled="disabled"&gt;Select Supervisor&lt;/option&gt;
  &lt;option value="5" disabled="disabled"&gt;Tom&lt;/option&gt;
  &lt;option value="6" disabled="disabled"&gt;John&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>My question is how do I access the option value. I tried using </p>
  
  <pre><code>   $('select[option[value*='+$val+']]').removeAttribute
  </code></pre>
  
  <p>I just want to remove the attribute from the value selected.
  $val is a value that I select in a checkbox and that selected value gets enabled in the select list. So when I check value 5 Tom will have his disabled attribute removed. But this doesn't seem to work. And I tried using:</p>
  
  <pre><code>document.getElementByID('SupervisorID').options[$val].removeAttribute('disabled');
  </code></pre>
  
  <p>But when the value is 5 or 6 and there's only 2 option there isn't a 5th or 6th value in the list. In this way when there's 2 values and I check the second one (John with the value 6) in the select list it selects the 6th value of the list, when there isn't one.</p>
  
  <p>I would like to do this the first way, not with the options[$val] way, although any help is appreciated.
  Thank you for your answers.</p>