Ads by ProfitSence
Close

Create a HTML Button acts as a Link

Last Updated on Wednesday 5th Oct 2022
  • 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