Simulate an anchor link with span

Simulate an anchor link with span so browser don't show the link address on hover. Made for: http://stackoverflow.com/questions/12911902/hide-anchor-display-on-status-bar

by gnel

HTML

<span class="link" rel="#myanchor">click me</span>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<div id="myanchor">
    My Anchor DIV
</div>

CSS

span.link {
    text-decoration: underline;
    color: blue;
    cursor:pointer;
}

JavaScript

$('.link').bind('click', function() {
    window.location.hash = $(this).attr('rel');
});