SyntaxFix
Write A Post
Hire A Developer
Questions
This is what you have to do
var fileVariable =document.getElementsById('fileId').files[0];
If you want to check for image file types then
if(fileVariable.type.match('image.*')) { alert('its an image'); }