I have following a tags:
Any tab1 Label
tab2 Label
Any tab3 Label<
Try this -
<a href="#tab1">Any tab1 Label</a>
<a href="#tab2">tab2 Label</a>
<a href="#tab3">Any tab3 Label</a>
<script type="text/javascript">
$('a').click(function(){
alert(this.hash.split('#')[1]); //This will alert # part in clicked anchor tag
});
</script>
function tellMyName() {
alert(this.hash.substr(1));
}
$('a').click(tellMyName);