+ 4
How can I close the window if input is wrong
I am practicing to make a password protection website and I want to make a program in which if the user writes wrong password then the website closes Please tell the answer in JS
12 Answers
+ 3
Use validation and window object
if you open window using undergiven method.
Onclick button let a fxn happen as
Function name(){
var w = window.open(url,_blank);
}
Then
If( incorrect password){
w.close()
}
I hope this will work
+ 3
Scripts closing current window/tab had been frowned upon from its notoriety "bad reputation". Browser vendors are not happy with such scripts, causes users' inconvenience at least. Anyways, you go read this đ
https://www.thesitewizard.com/javascripts/close-browser-tab-or-window.shtml
+ 3
Thanks
if you are free can you send me a code pls
+ 2
Then tell me a way in which I can redirect the person to another window if he fills wrong password
+ 2
In validation fxn
state to return false if password wrong
In this way he will be stand at login page untill doesn't type correct password
+ 2
I will type a code and send here tomorrow
Please tell me my mistakes if I write the code wrong
+ 2
Here you can set you requirement in if condition .
If password =12345 user can do what you allow else nothing else trying password
https://code.sololearn.com/W16L10S6o03P/?ref=app
+ 2
Thanks alot
+ 2
Don't forget to link your project heređđ
+ 1
what does it mean by fxn and which URL should I write
+ 1
Yeah
+ 1
How I store data in inner HTML