Ask coding questions

← Back to all posts
I need help with getting buttons to going to a page
_10cps_ (0)

I need help getting my buttons when I click them to go to a certain website for example to help people on stuff EDIT: HTML

Answered by Vandesm14 (2167) [earned 5 cycles]
View Answer
Vandesm14 (2167)

Use <a href="">Link Name</a>

Please upvote this if it helped you out 👍

_10cps_ (0)

@Vandesm14 that links it with the buttons?

Vandesm14 (2167)

@_10cps_ I'm not sure what you mean by "links it with the buttons". Are you talking about a HTML button as a link?

_10cps_ (0)

@Vandesm14 Yeah, so it takes it to another website

ArchieMaclean (750)


<a href="https://link/to/page"><button>Button text</button></a>

Please upvote if this helps :)

Zeune (17)

Please post the language that you are trying to do this in.

Vandesm14's answer would work if you wrote a script to react for the button to take you to a new webpage. If you are in Java you would write an actionListener, otherwise we will need more information to assist you.

Zeune (17)

@_10cps_ If you are still wondering create your <a href="">Put your code for the button here (between the href tag) </a>

_10cps_ (0)

@Zeune that doesn't help ? im looking how to connect my buttons with another website to link so when the click the buttons it sends them to a direct link

Zeune (17)

@_10cps_ That will work (tested in my project below). Link your project for additional help.

worked for me in my project:

For more information on how Buttons in html work reference


_10cps_ (0)

@Zeune that's helped thanks