I want to create a website that asks the user to enter his login ID and password. Please help me to do it.
In this instance the login ID is abcd and password is abcd1234.
var a=prompt("Enter your user ID");
var b=prompt("Enter your password");
if(a=="abcd" && b=="abcd1234")
alert("Thank you for visiting");
alert("Wrong ID or password!!");
Well, you could redirect them, if they haven't entered the correct credentials, by simply setting the window location to something else.
window.location.href = 'www.google.com'
Or you can just close the window, by calling.
Of course, the name and password here are stored client side, so a fairly proficient user can simply read it from the source code. If you want it to be secure you can do it on the backend, but that requires knowledge of a backend language and makes the scope of the question considerably bigger.