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.



     alert("You clicked here");

    alert("You form submitted");

Suggest An Answer