By checking the source you can see:
/**
* Bind an event handler to the "submit" JavaScript event, or trigger that event on an element.
*
* @param handler A function to execute each time the event is triggered.
* @see {@link https://api.jquery.com/submit/}
* @since 1.0
* @deprecated 3.3
*/
However it seems this isn't mentioned in the jQuery blog here. What is the alternative for this that it's now being marked deprecated?
You can use .on
$(selector).on("submit", callback)
Read more about it at http://api.jquery.com/on/
I was also searching for this but in my case I wanted to trigger submit. In that case you do it by triggering the event:
$(selector).trigger("submit")
It isn't deprecated, you can check here the .submit()
API docs:
https://api.jquery.com/submit/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With