As Richard mentioned, JavaScript cannot access the local client's PC's file system. That would be a huge security risk.
However, if you are referring to the server then you can use jQuery's .ajax() method,
jQuery.ajax() | jQuery API Documentation[
^] to call a webservice that checks the file system on the server and returns an appropriate response.
Note, if you are checking the server you'll need to make sure the account shown as the identity of the application pool in IIS will need permissions to the file system or else it checking will always return false.