Modify ↓
Ticket #11904 (closed bug: invalid)
'change' event no triggered if you modify `val()` by code
| Reported by: | fguillen.mail@… | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | None |
| Component: | unfiled | Version: | 1.7.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
If I have a textfield with a handler listening to "change" event it is not triggered if I do it by code.
For example:
$('#size').on( "change", function(){ console.log( "size changed" ); } );
$('#size').val( "small" );
This does not "trigger" the event handler.
jsFiddle: http://jsfiddle.net/fguillen/TRCk7/
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

As is said [here]( http://stackoverflow.com/questions/7055729/onchange-event-not-fire-when-the-change-come-from-antoher-function/7055771#7055771) this is the proper behavior following the HTML specifications but still I think it is not the behavior expected for a JS programer perspective.