title: If statement confusion - how to display a div if file is selected
body: <p>If file is selected show <code>h1</code> div else hide it. Maybe I have gone absolutely the wrong way in terms of calling <code>alert()</code>.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
   function foo() {
      var f = document.getElementById("f1");
      var h = document.getElementById("h1");
      alert( ""==f.value ? " f == nothing selected" : "f = file selected");
      alert( ""==h.value ? " h == nothing selected" : "h = file selected");
      if(alert( ""==f.value "f = file selected"){
          $('#h1').show();
      }else{
          $('#h1').hide();
      }
    }
  &lt;/script&gt;
  &lt;style type="text/css"&gt;
  #h1{
      display:none;
  }
  &lt;/style&gt;
  &lt;input id="f1" type="file"&gt;
  &lt;input id="h1" type="file"&gt;
  </code></pre>