A button styled like a hyperlink

Don't use <a href="#"> if you need an action element that looks like a link on your page. Links have to remain links (with valid target URL), otherwise use buttons and style them with CSS as you wish.

by dipish

HTML

<button class="button-action button-action-light" id="action1">Click me</button>

CSS

.button-action-light {
    border: none;
    background: none;
    padding: 0;
    color: blue;
    border-bottom: dashed 1px blue;
    cursor: pointer;    
}
.button-action-light:hover, 
.button-action-light:focus {
    border-bottom-color: red;
    outline: none;
}
.button-action-light:active {
    color: red;
}

JavaScript

document.getElementById('action1').addEventListener('click', function() {
    alert('Thank you!');
});