The onclick event occurs when the user clicks on an element. When a user clicks on an element with the mouse or touches an element in a touchscreen environment. We can listen for click events on an element in so many ways.
One way we can do this is to add an onClick attribute directly to the element