Hi everyone. I have a function that is called by both the onClick event and the onMouseOut event. I would like to know if it's possible to know from inside the function wich event called it. Thanks in advance.
An easy way would be to pass an argument to the function:
<script>
function myFunc(onWhat){
alert("This function was called using the "+onWhat" event."
}
</script>
<input type="text" onclick="myFunc('onclick')" onmouseout="myFunc('onmouseout')">
Adam while(ignorance==true){perpetuate(violence,fear,hatred);life--};
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.