726 Part III . Document Objects Reference function (Graphic web design)
726 Part III . Document Objects Reference function buttonEvent() { event.cancelBubble = true document.body.fireEvent( onclick , event) } By cancelling event bubbling, the event does not propagate upward to the enclosing FORM element. Instead, the event is explicitly redirected to the BODY element, passing the current eventobject as the second parameter. When the event handler function for the BODY element runs, its event object has information about the original event, such as the mouse button used for the click and the coordinates. But the event.srcElementproperty points to the document.body object. As the event bubbles upward from the BODY element, the srcElementproperty continues to point to the document.body object. You can see this at work in Listing 29-6 for IE5.5+. Listing 29-6: Cancelling and Redirecting Events in IE5.5+