In any case, it works that in if it doesn't matter what was entered in the prompt how to deal with it?

var user function login() { user = prompt("Введите свой ID"); alert(user); if ( user = "username") { alert("123") } } 

Closed due to the fact that off-topic participants zb ' , Alexey Shimansky , Visman , aleksandr barakin , Sasha Omelchenko 21 May '17 at 16:04 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - zb ', Alexey Shimansky, Visman, aleksandr barakin, Sasha Omelchenko
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • 2
    Correct user == "username" - br3t
  • @ br3t God, everything was simple, thanks! - Lspewz

0