This is advanced event handling. Good programming would find answers to all of these problems. Some problems do have solutions without advanced event handling, but if we are able to use advanced event handling, we will find that simple and practical solutions to these sort of problems are readily available. So, if you press a key, it cancels your onkeypress event. Event Bubbling is slightly more involved, and uses the hierarchical nature of a web document.
Elements have owners, or parents.
An image on a document is owned by the document. This means that an event on the image creates an event for the document, and so on. Mouse Capture is when we transfer all the events for a document to a single element, giving that element the capture. We will look at all of these concepts in more detail in this article, beginning with Cancelling Events. Cancelling Events Cancelling Events allows us to prevent the event from being handled by the computer's inbuilt event handlers.