0
How to redirect with javascript in a conditional?
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.
1 Answer
0
Try window.location.href=ââ and if that dosnt work try window.location.replace()