-2

I have this button for logging in to my website that is linked to a function in my javascript. But how can I also set the location to direct to another html page after logging in?

<div id="button_container">
          <button onclick="login()">Login</button>
        </div>
hairdye
  • 45
  • 5
  • Are you wanting the button to go to another page after being clicked? If so then it needs to be included in the Javascript. window.location can be used to redirect to another page if this is what your question is asking. – Aurange Mar 08 '22 at 02:22
  • what is your backend for authenticate? – Lee Mar 08 '22 at 02:22
  • https://stackoverflow.com/questions/5411538/redirect-from-an-html-page – PR7 Mar 08 '22 at 02:24
  • @Lee Hi I am using firebase – hairdye Mar 08 '22 at 03:28

1 Answers1

1

Add to login()

window.location.href = 'login.html';

Check this thread for more info

David Salomon
  • 804
  • 1
  • 7
  • 24