<button id="a" onclick='whichButton()'>a1</button>
<button id="a" onclick='whichButton()'>a2</button>
<button id="a" onclick='whichButton()'>a3</button>
<script>
function whichButton()
{
alert(event.srcElement.innerText);
}
</script>
<button id="a" onclick='whichButton()'>a2</button>
<button id="a" onclick='whichButton()'>a3</button>
<script>
function whichButton()
{
alert(event.srcElement.innerText);
}
</script>
<button id="a1" onclick='whichButton()'>a2</button>
<button id="a2" onclick='whichButton()'>a3</button>
<script>
function whichButton()
{
alert(event.srcElement.id);
}
</script>
<button id="a1">a2</button>
<button id="a1">a3</button>
<script for="a1" EVENT="onclick">
alert(event.srcElement.innerText)
</script>
<button id="a">a2</button>
<button id="a">a3</button>
<script>
document.onclick=function(){alert(event.srcElement.innerText)}
</script>