Onclick- it is a mouse event and occurs when the user clicks the left button of the mouse.

Onsubmit- it is a form event and occurs when a user is trying to submit the form. When form validation is used, then this is considered.

BY Best Interview Question ON 07 Jul 2019


     alert("You clicked here");

    alert("You form submitted");