Diszkrét js esemény létezésének lekérdezése
addEventListener-el és/vagy attachEvent-el létrehozott eseményeknek a létezését, hogy lehet lekérdezni? getAttribute('onclick')-re csak null-al tér visszi, meg különben is ez HTML szintű lekérdezés.
■
erre gondolsz? ( zanásítva sehogy)
One problem of the current implementation of W3C’s event registration model is that you can’t find out if any event handlers are already registered to an element. In the traditional model you could do:
alert(element.onclick)
and you see the function that’s registered to it, or undefined if nothing is registered. Only in its very recent DOM Level 3 Events W3C adds an eventListenerList to store a list of event handlers that are currently registered on an element. This functionality is not yet supported by any browser, it’s too new. However, the problem has been addressed.
Fortunately removeEventListener() doesn’t give any errors if the event listener you want to remove has not been added to the element, so when in doubt you can always use removeEventListener().
http://www.quirksmode.org/js/events_advanced.html
Igen
ha te hozod letre akkor egyszeru
ha meg prototype (kinél nem ? :) )
pl.
Nálam nem prototype