+ 2
How to make a java code which will take a PIN and if it's true, it will perform the functions of class A otherwise it will omit?
2 Réponses
+ 3
First, you will have to need some kind of input. This can be an alert-prompt, or an input-field. Then, when the user wants to continue, you could use an if-statement to check if the input contains the correct PIN. If the PIN is incorrect, you can return false and whatever message you'd like.
+ 2
var pass= prompt("Enter Password");
if (pass == 0000) // replace "0000" with your desired password
{alert("allowed.");
//some code
}
else {alert("not allowed");
}