Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I link two HTML pages with a button? [duplicate]

Tags:

html

button

I've got two HTML pages, with one being an opening page for an application and the second being a login page. I have a button on the opening page and I want to be able to click on it and have it take me to the login page. How do I do this?

like image 789
Corbin Smith Avatar asked Jul 20 '15 20:07

Corbin Smith


3 Answers

This will add a button and link it to the login page:

<a href="path_to_login_page">
  <button>Take me to the login page</button>
</a>

Change path_to_login_page & Take me to the login page to customize the button. If you already have a customized button and want to use it:

<a href="path_to_login_page">
  'Place your button here'
</a>
like image 122
nextstep Avatar answered Oct 21 '22 23:10

nextstep


Personally I would just change the button to a standard anchor. You could still style the link to make it look like a button.

<a href="index.html">Go home</a>

If the element really must remain a button, you could do this:

<button onclick="location.href='index.html'>Go home</button>

It's not exactly best practice, though.

like image 2
kieranpotts Avatar answered Oct 21 '22 22:10

kieranpotts


THIS IS THE SHORTEST AND THE FASTEST WAY TO DO IT:

<a href="login-page.html">
<button> Login Page</button>
</a>

Run and Check it here: https://jsfiddle.net/2zov6q2v/14/

like image 2
buggytuf Avatar answered Oct 21 '22 22:10

buggytuf