Prevent anchor behaviour

An example of a gracefully degrading solution:

<a href="https://stackoverflow.com/questions/4387580/no-script.html" id="myLink">link</a>

<script>
document.getElementById("myLink").onclick = function() {
    // do things, and then
    return false;
};
</script>

Demo: http://jsfiddle.net/karim79/PkgWL/1/

Leave a Comment