Ask coding questions

← Back to all posts
1
I need help with getting buttons to going to a page

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 (408)
[earned 5 cycles]
View Answer
Commentshotnewtop
3

Use <a href="website.org">Link Name</a>

Please upvote this if it helped you out 👍

1

@Vandesm14 that links it with the buttons?

1

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

1

@Vandesm14 Yeah, so it takes it to another website

2

@_10cps_

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

Please upvote if this helps :)

1

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.

1

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

1

@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

3

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

worked for me in my project: https://repl.it/@Zeune/ZsBlog

For more information on how Buttons in html work reference

w3schools: https://www.w3schools.com/tags/tag_button.asp

1

@Zeune that's helped thanks