DEV Community

Discussion on: Trigger an onClick event outside the child element, works for nested child components too.

Collapse
 
mishrabhavesh profile image
Bhavesh Mishra

Is adding domElement.onClick = callback func equivalent to domElement.addEventListener('click', callback func) ?

Collapse
 
prakis profile image
Kishore

Yes, they does the same thing, the first one uses the other.