how can i extract text after hash # in the href part from a tag?

Viewed 42792

I have following a tags:

<a href="#tab1">Any tab1 Label</a>
<a href="#tab2">tab2 Label</a>
<a href="#tab3">Any tab3 Label</a>
<script>
function tellMyName()
{
    alert(this.href);
}

</script>

Now i want to bind the tellMyName function to all the a tags and get tab1 if Any tab1 Label is clicked, tab2 if tab2 Label is clicked and so on...

8 Answers
Related