First of all create a *.html page you want to hide behind your password and a *.js file named the same as you want your password to be, with only one line:
For example I want to hide a secret.html file and I want the password to be: pass123 so I name the file pass123.js. In the pass123.js file I write:
On the page that you want to lead to your secret file just use this script:
It shows the prompt window for the password and redirects you to the hidden page if the password is right.
Simple as that.