This code should work in IE (don\'t even test it in Firefox), but it doesn\'t. What I want is to display the name of the attached file. Any help?
$('input[type=file]').change(function(e){ $(this).parents('.parent-selector').find('.element-to-paste-filename').text(e.target.files[0].name); });
This code will not show C:\fakepath\ before file name in Google Chrome in case of using .val().
C:\fakepath\
.val()