After multiple attempts, I'm still struggling with creating a password field for my webpage. Here's what I have come up with so far:
<form name="PasswordField" action="">
Password:
<input type="password" name="password">
<input type="button" value="Log in">
</form>
I know it's not the best, but it doesn't need to be fancy. All I need is for it to retrieve the password from the textbox and compare it to the page's set password. I'm thinking of using an if-else statement, but not sure how.
*Code to extract password from textbox when "Log in" button is clicked*
if (password = "rawr")
{alert('Correct!')}
else
{alert('Wrong Password')}
Unfortunately, after spending hours on this task, nothing seems to be working for me. I even attempted using functions, but that also didn't yield any positive results.