When the object is clicked, the prompt shows up, but nothing happens when the answer is submitted. Is there an issue with the naming of the password? Any advice much appreciated!
<div class='one'><p onclick="password()">Click me!</p>
<script language="JavaScript">
var password;
var pass1="thailand";
password = function password() {
prompt('What was the first country we visited together?');
};
if (password == pass1)
{ window.location=meesha.html;
} else {
console.log('sorry, try again!')
};
</script>
</div>
Aucun commentaire:
Enregistrer un commentaire