How to open an word or excel file in client application using JS?

I have a custom Page in SharePoint, where I retrieve All the documents(in .docx,.xlxs,.pdf) and show these files in a tabular format.

What I want, when I click on some document(say a link button) should open the file in a client application like MS Word, MS Excel, Adobe Reader. Though I am able to open them in the browser itself

Open in Client is already Enabled in Document Library

I have gone through this link, but it didn’t help me out.