title: Enable an HTML form text box based on the value of a drop down menu in the same form?
body: <p>I'm new to HTML and I'm aware that this question has been asked several times on here, but I've tried all the various solutions and none have worked for me.  I'm trying to activate a field (which defaults to disabled) when one of two values is selected from a drop down menu. This is the JavaScript function I have written to accomplish the task.</p>
  
  <pre><code>function changeTextBox() {
      comp = document.getElementById('comparator');
      if(comp.value=='equalto'||comp.value=='notequalto')
          document.getElementById('localevalue').disable=false;
      else
          document.getElementById('localevalue').disable=true;    
  }
  </code></pre>
  
  <p>This is the drop down menu</p>
  
  <pre><code>&lt;label style="font-size:16px" for="comparator"&gt;Comparator:&lt;/label&gt;
  &lt;select id="comparator" name="comparator" onChange="changeTextBox();"&gt;
      &lt;option value="lessthan"&gt;Less Than&lt;/option&gt;
      &lt;option value="lessthanequalto"&gt;Less Than or Equal To&lt;/option&gt;
      &lt;option value="greaterthan"&gt;Greater Than&lt;/option&gt;
      &lt;option value="greaterthanequalto"&gt;Greater Than or Equal To&lt;/option&gt;
      &lt;option value="equalto"&gt;Equal To&lt;/option&gt;
      &lt;option value="notequalto"&gt;Not Equal To&lt;/option&gt;
      &lt;option value="exists"&gt;Exists&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>And this is the field that needs to be activated when 'Equal To' or 'Not Equal To' are selected from the drop down menu.</p>
  
  <pre><code>&lt;label style="font-size:16px" for="value"&gt;Value:&lt;/label&gt;
  &lt;input type="number" id="value" disabled/&gt;
  </code></pre>
  
  <p>But when I select one of the fields, the box remains deactivated.  Can anyone tell me what I'm doing wrong?</p>