Create a HTML Button acts as a Link

Last Updated On Wednesday 1st Sep 2021
  • Sometimes You may want to use a button to link to another page or website.

html button href

  • Simply wrap your <button> tag in an <a> tag.
	<a href='https://'><button>Hello</button></a>
	

html5 button link

  • To use an HTML button as a link, you have to add some JavaScript code.
	<button onclick="window.location.href='somewhere'">Continue</button>
	
	<button onclick="document.location='home'">HomePage</button>
	

References