title: jQuery: show/hide element based on selected option
body: <p>I want to show element with <code>id=attach</code> when the option with <code>value='Attached File'</code> is selected.  Please help me to understand why my code does not work.</p>
  
  <p>My code:</p>
  
  <pre><code>&lt;ul class="form-list"&gt;
    &lt;li id="excellence-form"&gt;
      &lt;fieldset&gt;
        &lt;ul&gt;
          &lt;li class="wide"&gt;
            &lt;label for="excellence:like" class="required"&gt;&lt;em&gt;*&lt;/em&gt;&lt;?php echo $this-&gt;__('Initial Data') ?&gt;&lt;/label&gt;
            &lt;div class="input-box"&gt;
              &lt;select class="required-entry" name="excellence[like]" id="excellence:like"&gt;
                &lt;option value='0'&gt;&lt;?php echo $this-&gt;__('Please Choose..');?&gt;&lt;/option&gt;
                &lt;option value='Not Attached' &lt;?php if($this-&gt;getQuote()-&gt;getExcellenceLike() == 1){echo 'selected="selected"';} ?&gt;&gt;&lt;?php echo $this-&gt;__('Do Not Attach File');?&gt;&lt;/option&gt;
                &lt;option value='Attached File' &lt;?php if($this-&gt;getQuote()-&gt;getExcellenceLike() == 2){echo 'selected="selected"';} ?&gt;&gt;&lt;?php echo $this-&gt;__('Attach File');?&gt;&lt;/option&gt;
              &lt;/select&gt;
            &lt;/div&gt;
          &lt;/li&gt;
          &lt;li id="attach" style="display:none;" &gt;
            &lt;label class="required"&gt;&lt;em&gt;*&lt;/em&gt;&lt;?php echo $this-&gt;__('Please Attach :') ?&gt;&lt;span id='file_upload_text'&gt;&lt;/span&gt;&lt;/label&gt;
            &lt;div class="input-box"&gt;
              &lt;input id="file_upload" type="file" name="file_upload" /&gt;
            &lt;/div&gt;
            &lt;input id="file_upload_path" type="hidden" name="file_upload_path" class='required-entry' /&gt;
            &lt;input type="hidden" value='Attached File' name="file_upload_type" class='required-entry' /&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
      &lt;/fieldset&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>My jQuery:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    $(function() {
      $('#excellence:like').change(function(){
        if ($(this).val() == "Attached File") {
          document.getElementById("attach").style.display="block";
        } else {
          document.getElementById("attach").style.display="none";
        }
      });
    });
  &lt;/script&gt;
  </code></pre>