var functionVariable = (function() {
return {
'initialize': function(className) {
// Here, I need to access the <a> tag and apply the specified className
}
};
}());
<a href="#" onmouseover="functionVariable.initialize('myClass')">Link</a>
Given the code above, is there a way to implicitly pass this
to functionVariable.initialize
?
I am aware that I could modify the initialize
function to function(className, element)
and then use
onmouseover="functionVariable.initialize('myClass', this)"
to access the element. However, I am curious if it is possible to achieve this without explicitly passing this
in the inline event listener.