title: Allow only pdf, doc, docx format for file upload?
body: <p>I am triggering a file upload on href click.<br>
  I am trying to block all extension except doc, docx and pdf.<br>
  I am not getting the correct alert value.</p>
  
  <pre><code>&lt;div class="cv"&gt; Would you like to attach you CV? &lt;a href="" id="resume_link"&gt;Click here&lt;/a&gt;&lt;/div&gt;
      &lt;input type="file" id="resume" style="visibility: hidden"&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>        var myfile="";
          $('#resume_link').click(function() {
              $('#resume').trigger('click');
              myfile=$('#resume').val();
              var ext = myfile.split('.').pop();
              //var extension = myfile.substr( (myfile.lastIndexOf('.') +1) );
  
              if(ext=="pdf" || ext=="docx" || ext=="doc"){
                  alert(ext);
              }
              else{
                  alert(ext);
              }
           })
  </code></pre>
  
  <p><a href="http://jsfiddle.net/YSQ9H/" rel="noreferrer">MyFiddle</a>..its showing error</p>