I am having trouble getting the parent node of a br element which triggered a ClipboardEvent.
What I am trying to achieve is to recursively match its parent to a certain class, but the br element's parentNode property is null:
Here is the DOM tree:
The path property of the ClipboardEvent seems to capture the hierarchy but it is not standard:
Update:
I figured out why this is happening.
The br element was replaced by some new element upon pasting by the first event handler, and in my 2nd event handler(this one that I am having issue with), br is no longer in DOM tree.