Edit: To clarify, what I want to ask is: In what scenario will you prefer one over another? (maybe an advantage on either one of the syntax?)
What is the difference between:
.trigger('change')
and .change()
Both works as expected. Is there any cases where both will behave differently?
The JQuery documentation for .change() says:
This method is a shortcut for .on( "change", handler ) in the first two variations, and .trigger( "change" ) in the third.
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