To make an HTML button act like a link, use a <button>
element with JavaScript or style an <a>
tag as a button. For the <button>
, set an onclick
attribute like this:
Alternatively, style an <a>
tag using CSS to mimic a button:
Both approaches are widely used and effective.