Ask coding questions

← Back to all posts
Href not working
h
okalisl

I am working on a game with a login system and was trying to get the href system working but it just refused to return another page. Anyone know whats going on?

Answered by SixBeeps [earned 5 cycles]
View Answer
Voters
okalisl
Comments
hotnewtop
SixBeeps

<button> elements do not have an href property. You'll have to either change to <a> tags, or link the buttons to some JavaScript code that redirects to the page you want it to go to.

okalisl

Thanks @SixBeeps!

AR199

FYI you can just add an onclick property and set it to document.location = "https://www.link.com

okalisl

Thanks for the help @AR199