This is working you can refer this and use:
function listname1(sender)
{
alert(sender.innerText);
}
<a href="#" onclick="return listname1(this)" id="hollywood">A</a>
P.S. I hope i understood the problem correctly and the solution works for you if not do let me know.