What all events can be triggered programmatically using jQuery? Also is there any important differences to be remembered when one is doing event triggering using jQuery Vs a natural way of it being triggered?
What all events can be triggered programmatically using jQuery? Also is there any important
Share
Every event can be programmatically fired, just use the callback-less version of it.
Example:
About your second question, there should be no difference between the native and jQuery event handlers.
One thing that is neat though is that jQuery binds
thisto the element that received the event, inside the callback (this doesn’t happen in native event handlers):Warning: the element referenced by
thisis not “jQuery augmented”. If you want to traverse or modify it with jQuery goodness you’ll have to do something likevar $this = $(this);