title: Change color of border on file upload based on if file is selected or not
body: <p>I'm trying to change the border color of the <code>label</code> border based on if a file is selected or not. I am using the following jQuery and it always runs the first if statement resulting in a red border. I'm thinking that something is wrong with my if statement but I'm not sure.</p>
  
  <pre><code>&lt;input type="file" name="file" id="file"&gt;
  &lt;label for="file" id="file_display"&gt;Select File&lt;/label&gt;
  
  $("#file").click(function(e) {
          if ($("#file").val().length == 0) {
              $("#file_display").css("border", "5px solid red");  
          } else {
              $("#file_display").css("border", "5px solid green");    
          }
  });
  </code></pre>