jQuery trigger onChange

user1018809 picture user1018809 · Feb 5, 2012 · Viewed 33.3k times · Source

I have a input text field which is filled with the url of an image using a jQuery function. How do I use the "onChange" event of the input to run the jQuery function?

Answer

Slawomir Wdowka picture Slawomir Wdowka · Feb 5, 2012

If you update field by JavaScript, than after changing value just call on it change()

$('#myId').val('new_url').change();