-2

This is my code:

$('submit').on('click', function (){
    var num = document.getElementById('number').value;

    if(num !== ' '){
        window.location = 'userAuth.htnl';
    }
});

But after I type something into the DOM element and submit it doesn't redirect. But if I console log my input in the conditional, I see it on the console.

Please help.

Eddie
  • 26,593
  • 6
  • 36
  • 58

1 Answers1

0

In your code you have 'userAuth.htnl';. Change that to 'userAuth.html';

$('#submit').on('click', function (){
    var num = document.getElementById('number').value;

    if(num !== ' '){
        window.location.replace('userAuth.html');
    }
});
thatguy
  • 1,249
  • 9
  • 26