I am triggering a file upload on href click. I am trying to block all extension except doc, docx and pdf. I am not getting the correct alert value.
&
Try this
$('#resume_link').click(function() { var ext = $('#resume').val().split(".").pop().toLowerCase(); if($.inArray(ext, ["doc","pdf",'docx']) == -1) { // false }else{ // true } });
Hope it will help