This is in regards to jquery where we add a event using on/ click can someone point out difference between submit and click | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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 (){})

2nd Nov 2018, 5:30 AM
SHAILA BHAGWAT
3 Answers
0
Click event for single element Submit event is for validation of multiple inputs in a form
2nd Nov 2018, 7:54 AM
onekpsc
0
Can you be more precise and explain with some example
2nd Nov 2018, 7:56 AM
SHAILA BHAGWAT
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)
2nd Nov 2018, 3:38 PM
Janning⭐
Janning⭐ - avatar