I suggest you use the HTML element that was created for this task, our good old friend <a>
;)
<a href="http://myurl.com">My text</a>
By default, it looks like a blue link, which I think is what you are trying to avoid. But it's much easier to change the style of the link, rather than try using other elements that usually do not redirect to other pages.
Add this to a CSS file, or to a <style>
tag on your page:
a {
text-decoration: none; /* no underline */
color: black; /* changes the color of the text*/
background-color: red; /* changes the background color*/
padding: 10px; /*this makes sure you have some open space so your item looks like a button */
}
Note that this CSS snippet changes the style of ALL <a>
elements on the page. It looks like a button, but if you click it, it still works like a link.
Update
If you also want to remove the underline when you hover over the link, also add the following to the CSS:
a:hover { /* :hover is the state of the item when the mouse is over it, but you're not clicking (yet) */
text-decoration: none; /* no underline */
}