chant9
Technical User
- Aug 30, 2005
- 7
Hi
I have been adding event listeners to forms and form elements like text boxes using addEventListener and attachEvent. However if I add an onclick it overwrites any existing onclick event.
Does anyone know how to check what events are currently attached to an element?
I currently have a function that does this for window onload events, it accesses window.onload then if this exists it strings together the existing code with the new code so it doesn't overwrite previous events. I haven't been able to do a similar thing for element events though.
Cheers
I have been adding event listeners to forms and form elements like text boxes using addEventListener and attachEvent. However if I add an onclick it overwrites any existing onclick event.
Does anyone know how to check what events are currently attached to an element?
I currently have a function that does this for window onload events, it accesses window.onload then if this exists it strings together the existing code with the new code so it doesn't overwrite previous events. I haven't been able to do a similar thing for element events though.
Cheers