I'm trying to understang how events, capturing and bubbling work. And there's some thing that is a bit unclear to me. Where an event is generated? In other words where an event starts going to the target element from? Some articles say events are created by window and then are propagated to document and so on. And some other say events are created in document. The javascript info website has an image where window is included so it makes me think that it is the window that generates events. But document has a .createdEvent method...
Using the document object, we can manipulate the content of the html document (DOM) - add events to elements. With the help of the window object, we can manage windows - it is higher in the hierarchy above the document, so all user events pass through it first.