When the form first loads, the login_attempts hidden element has an empty string as its value. When the onClick event of the form’s button is triggered for the first time, the function above sets the value of the hidden element to 1. Thereafter, for every attempt, it increments the value of login_attempts by 1. The code above also checks for the login and the password and prompts the user.