<a id=myanchor href='http://example.com'>Example</a>And you want it to call a function instead of going to the URL, do this with jQuery:
$('#myanchor').attr('href','javascript:void(0)').click(onClickAnchor);This neutralizes the href. And will make it call function onClickAnchor() with the user clicks.