This article demonstrates executing any operation when we click the right mouse button. For example, we want to change the background color of a box when we click the right mouse button.
Output : The following output will be shown in the browser and when we click the right mouse button on the box in the above image.
- Before right click:
- After right click:
Note: Using this method we can perform a lot of things, we can add a menu on our right-click.