How Do You Use Onclick Function Of Javascript In Html?
I’ve modified it to do what you want it to. BUT, let me tell you that this is not the way to verify a password. It’s pointless, because all a person has to do is disable javascript or check the page source and they’ll know the password right away. You need to use PHP to verify a password. See the second example below the JavaScript one. The advantage of PHP is that it’s executed on the server rather than the client. This means that the user ONLY sees the HTML part of the page and never sees the PHP code. Remember that in order to function, PHP has to be installed on the server, and the name of the file has to end in “.php” intead of “.html”. Example 1 (with JS):