+ 3

How to get password checked in js

please send a code such that . in that code the user must enter password 5732 in js and then the page must visible.

2nd May 2018, 6:24 AM
keev23i
keev23i - avatar
3 Answers
+ 4
var password=5732; var check=prompt("enter password"); if(check == password){ alert("password matched") }else{ alert("password not matched") }
2nd May 2018, 7:23 AM
Sudarshan Rai
Sudarshan Rai - avatar
2nd May 2018, 6:36 AM
᠌᠌Code X
᠌᠌Code X - avatar
+ 2
not that I want to set a password for my code with js
2nd May 2018, 6:37 AM
keev23i
keev23i - avatar