Reputation: 11
So I want to use a button to navigate to another website. I assume it has something with the "a href" tag to do. Thanks in advance! //Simon
Upvotes: 1
Views: 1071
Reputation: 97717
Here is a method without Css or javascript
<form action="http://example.com"><input type="submit" value="Go somewhere"></form>
Upvotes: 1
Reputation: 722
Assuming that you specifically want a button, you can set a url to location.href
:
<button onclick="location.href = 'https://stackoverflow.com'">Visit us!!</button>
Btw, try googling stuff first.
Upvotes: 0
Reputation: 4775
If you really want a button and not just an <a>
tag
<button onclick="window.location.href='http://example.com'">Navigate!</button>
Upvotes: 2