Given the code:
var event = new Event('build');
// Listen for the event.
elem.children[0].addEventListener('build', function (e) { ... }, false);
// Dispatch the event.
elem.dispatchEvent(event);
The child element's handler is not invoked. See https://jsfiddle.net/mvjh7700/
Is there a way to invoke the handler without dispatching the event directly on the child (or its descendants)? In my real use case, all sorts of elements (that are descendants, not direct children) listen to the build
event, and I don't know exactly which (and don't wish to mark them with a class).
Alternatively, for my use case, it would be OK if I could find all the elements that have handlers on 'build', then I can invoke the event on each. But still, I would like to know the answer to the original question