For instance if I select a radio button through jQuery code does this fire the onClick event for that particular input?
views:
226answers:
1
+2
A:
No, because that's not a click. You can trigger an event on an element with the trigger
method, or trigger any registered event handlers without triggering the default action using the triggerHandler
method.
hobbs
2009-10-12 21:15:39
Ok, bad example what about onChange? my question was more relating to in general would any such events occur.
yongjieli
2009-10-12 21:21:31
No again, because the "change" event is defined to be triggered when the data in a field is changed *by the user*. As far as I know, all events have similar caveats; they won't be triggered by code unless you go out of your way to simulate user interaction.
hobbs
2009-10-12 22:23:07
That makes sense, the trigger methods works well thanks hobbs.
yongjieli
2009-10-12 22:27:49