For the security concern, client-side JavaScript does not provide any way to read, write, create, delete, or list files or directories on the client/server computer. But one can use Ajax to read the file. This code snippet can be used to read from a text file.