Access parent element or parent node in html

By shaikhmo
In June 29, 2014
766 Views

I recently had a situation where I had to add couple of event listeners to the parent HTML element which was unknown, as it was dynamically added.

My code was to be embedded in a parent application which i had no clue about.

 

Simple way of adding an event listener to an html element

 

Adding event listener to unknown parent html element

 

 

Leave A Comment