I have the following jQuery code in place on my page:
var isChanged = false;
$(document).ready(function()
{
$(\'.change\').change(function() {
is
$('.change').change()
will fire the event. Just changing the attributes doesn't fire the event.
According to DOM Level 2 Event Specification:
The change event occurs when a control loses the input focus and its value has been modified since gaining focus.
That means that change event is designed to fire on change by user interaction. Programmatic changes doesn't cause this event to be fired.
That's the way it works. If you need the change of value to trigger the "change" event, you can explicitly do so by:
$('input#whatever').val('hi').change();