Event source element : Event Properties « Event « JavaScript DHTML
- JavaScript DHTML
- Event
- Event Properties
Event source element
<html>
<body>
<script language="JavaScript">
function function1() {
alert(window.event.srcElement.id);
}
</script>
<body id="myBody" onclick="function1();">
<button id="myButton1" onclick="function1();">Button One</button>
<button id="myButton2" onclick="function1();">Button Two</button>
</body>
</body>
</html>
Related examples in the same category