First working implementation of DOM events