How do i make a button that takes me to a new page when clicked | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

How do i make a button that takes me to a new page when clicked

15th Nov 2018, 5:51 AM
Webster
Webster - avatar
4 Answers
+ 6
<a href="https://www.google.com"> <button>Google Search</button> </a> Replace the href attribute to your desired URL and set button text also as necessary.
15th Nov 2018, 10:42 AM
Ipang
+ 4
<input type="button" onclick="location.href = 'https://www.wikipedia.org'" value="Click me" /> I'm using Wikipedia because it allows frames + will work on SoloLearn -- most major sites, like Google, MSN, Yahoo (etc) will detect the CodePlayground environment and deny navigation. This is only particular to this type of navigation here -- it should work fine at home / in a personally-managed web page.
15th Nov 2018, 7:14 PM
Kirk Schafer
Kirk Schafer - avatar
+ 3
I think you can use the action attribute of the form tag.
15th Nov 2018, 7:39 AM
Shuaib Nuruddin
Shuaib Nuruddin - avatar
0
here are a few methods; <form action=“#”><input type=“submit” value=“submit”/></form> or <a href=“#” type=“button”>//Enter here</a>
15th Nov 2018, 6:31 PM
Alex
Alex - avatar