0
This is in regards to jquery where we add a event using on/ click can someone point out difference between submit and click
$(.id).on('click', function (){}) or $(.id).on('submit', function (){})
3 Answers
0
Click event for single element
Submit event is for validation of multiple inputs in a form
0
Can you be more precise and explain with some example
0
Submit
https://www.w3schools.com/jquery/event_submit.asp
Click
https://www.w3schools.com/jquery/event_click.asp
To summarize the links above, the submit method attaches specifically to a form element (<form>stuff</form>) which usually has something like this:
<input type="submit"value="Submit">
toward the end of it, as referenced here:
https://www.w3schools.com/html/html_forms.asp
In contrast, the click method can be attached to any element.
( https://www.w3schools.com/jsref/event_click.asp)