I am making a password app where you first create a password and save it to a variable. Once the variable has the value, you can enter the password. If the user got it wrong three times, I want to hide the input box and show a message. So far it is working, but it doesn't compare the two variables. Here is my code:

```
<p id='password'></p>

<input type='password' title='enter your password'>
<input type="submit" onclick='passwords__()'>

<button onclick='savePassword()'>
Save Your New Password
</button>

<script>
var times = 0;
var input = document.getElementsByTagName('input')[0];
var passwords = document.getElementsByTagName('input')[0].value;
var buttons = document.getElementsByTagName('input')[1];
var buttons2 = document.getElementsByTagName('button')[0];

function passwords__() {
    times++;
    if (times === 3) {
        input.style.display = 'none';
        document.getElementById('password').innerHTML = 'You can\'t enter your password because you have not enter the right one for three times';
    }
    if (input.value === passwords) {
        alert('You\'re loged in');
    }

}
</script>

<script>
function firstCall() {
    buttons.style.display = 'none';
}
firstCall();
</script>

<script>
function savePassword() {
    buttons.style.display = 'block';
    buttons2.style.display = 'none';
}
</script>

```