Within Javascript, onclick doesnt mean anything on its own. For example, the developer must ensure that: Calls to OpenElement and CloseElement are correctly balanced. However, my react component is rendered within the body tag so I have no control over toggling classes based on a click within a react component. So in your example, even if you didn't have any other explicitly clickable elements in the div, every child element of the div would bubble their click event up the DOM to There has to be a reference to some object, so it knows whose onclick were talking about! The second parameter is an object that specifies player options. In the above example, when a user clicks on the paragraph element in the html, they will see an alert showing onclick Event triggered. One such object is window. If you do not want to include @angular/animations in your project you can override the default toast component in the global config to use ToastNoAnimation instead of the default one. You can apply CSS to your Pen from any stylesheet on the web. It is a great place to improve performance as it allows you to prevent a re-render if component receives a new prop. By default, an