Is there a way to transform/convert a regular javascript object into a event object?
What i mean is, I create an object that corresponds to a DOM selector element and pass it to a function which does some processing. But the function expects an event, and the processing is based on the event methods like currentTarget, target and it looks up by applying the parent() method (basically jQuery event).
I'm trying to pass the element which clearly fails. So, is there any way i can change my custom object to be the event object which the function is expecting??
Any suggestions/help is appreciated.
Thanks in advance!
Aucun commentaire:
Enregistrer un commentaire