Gunner Gunner - 1 month ago 4x
jQuery Question

JQuery detecting Programatic change event

If i do jQuery(expr).change( function), then I can get an event function to fire when the user makes a change to the value.

Is it possible to get this to fire if it's changed programatically, ie if I call jQuery(expr).val("moo").

or if some Plain old JavaScript changes it's value?

Thanks for any help.


After you've changed the value, you can fire the event yourself, and thus calling all the 'onchange' handlers.