I'm trying to reach a parent of some element:
let t = e.target.parentNode
but i have this Error: Property 'parentNode' does not exist on type 'EventTarget'
I've tried with <Element>e.target.parentNode
but this also not gives me any results. Can anybody help?
I had to wrap the typecasting in parentheses:
let parent = ( <HTMLElement>event.target ).parentElement;
or using parentNode:
let parent = ( <HTMLElement>( <HTMLElement>event.target ).parentNode );