Possible Duplicate:
How do you find out the caller function in JavaScript?
I have the following code:
JS:
function myfunc(mynumber){
console.log(mynumber);
}
HTML:
<div onclick="myfunc(5);"></div>
Is there a way, with jQuery, to be able to get the context of that element that was clicked inside the myfunc
function, without passing this
or $(this)
as a parameter in the onclick
attribute?