1.

What is the difference between onclick and onsubmit?

Answer»

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.

Example

$("p").click(FUNCTION(){
     alert("You clicked here");
});

$("form").submit(function(){
    alert("You form SUBMITTED");
});



Discussion

No Comment Found