Why doesn't the code work? Problem in cycle

function welcomeAnimate(){ var enter = document.getElementById("enter") var login = document.getElementById("login") var password = document.getElementById("password") var box = [login, password] enter.onclick = function (){ for(var i = 0; i > 2; ++i){ box[i].style.display = "block"; } } } 
  • one
    Before you ask questions, it would be better to watch the code. purely if it is logical to argue if i is zero, then the cycle will be executed while your zero is greater than 2? - Rimon
  • @Rimon And before you disgrace a person, think that it kills the desire for development, but the question was asked because of inattention, but the stack community was created to help on all issues. - Frog Frogov
  • @Zow Do not forget to put such characters for the logical conclusion of the line; (otherwise you will get rid of it) Readability is increased :) - Frog Frogov

1 answer 1

 for(var i = 0; i < 2; ++i){ box[i].style.display = "block"; } 

maybe so?