HTML button like link

I want to create a button that looks like a link (bule text with unerline and shows the hand when I put the cursor on it).
Or a link that acts like a button (onclick calls a function and does not open a page).
Who is Participating?
SjoerdvWConnect With a Mentor Commented:
Not sure i understand what you mean.... But if i do, this is what you're looking for:
 <!-- Beginning of JavaScript -
  function MsgBox () {
  alert ("Test") }
  // - End of JavaScript - -->
 <a href="javascript:MsgBox()">Test</a>

Open in new window

Om PrakashConnect With a Mentor Commented:

function Test()
<a href="#" onclick="javascript:Test()">This is test</a>

Open in new window

<a href="#"><div class="button" onClick="javascript:alert('clicked')" style="widows:300; height:300; cursor:hand">remove if you dont want this</div></a>
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.