729Chapter 29 .Event Objects case 1: return CAPTURING (Cpanel web hosting)

729Chapter 29 .Event Objects case 1: return CAPTURING break case 2: return AT TARGET break case 3: return BUBBLING break default: return } }

W3C DOM Event Propagation


If you want to remove event capture after it has been enabled, use the removeEventListener() method on the same object as the event listener that was originally added (see Chapter 15). And, because multiple event listeners can be attached to the same object, specify the exact same three parameters to the removeEventListener() method as applied to the addEventListener()method. Preventing NN6 event bubbling or capture Corresponding to the cancelBubble property of the IE4+ event object is an event object method in the W3C DOM. The method that prevents propagation in any event phase is the stopPropagation()method. Invoke this method anywhere within an event listener handler function. The current function executes to completion, but the event propagates no further. Listing 29-8 extends the example of Listing 29-7 to include two checkboxes that let you stop propagation type at the FORM element in your choice of the capture or bubble phase. Listing 29-8: Preventing Bubble and Capture W3C DOM Event Propagation