Reputation: 369
i am trying to execute DOM events within a function that expects the event to handle, such as onmouseover, onclick and so on, by name as a function parameter like so:
...
doSomething(target, 'onmouseover');
doSomething : function(tgt, evt)
{
...
o.evt = function() {
alert(evt);
}
...
}
...
The assignment does not throw any errors, so i guess, it is syntactically correct, but it does also not do the alert. Why?
(Please do not recommend using frameworks. I would like to understand my mistake and how to get this managed.)
Upvotes: 0
Views: 43