Gunner Gunner - 1 year ago 101
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.

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download