In this case, challenge is dom elements are created dynamically for different request and total number of dom elements are not fixed [e.g. may be 1 or multiple no of rows].
For example table/dom elements are created when there is a response from the web service. There is a save button on the web page but it will enabled only when there is any change on one of the element [change should not be identical to the last value].
Use the
.on()function’s event delegation syntax to bindchangeevent handlers to your inputs. Something like this:There’s more information about event delegation in the linked API page, particularly the Direct and delegated events section.
Note that the
.on()function was introduced in jQuery 1.7. If you’re using a version prior to that, you can get the same result using the.delegate()function instead – just switch the first two arguments around.