Ticket #1976 (closed bug: duplicate)
.change() doesn't work for <SELECT>
| Reported by: | BartekR | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.2.2 |
| Component: | core | Version: | 1.2.1 |
| Keywords: | SELECT .change() | Cc: | |
| Blocking: | Blocked by: |
Description
HTML:
<select name="status" id="status"> <option value="0">Option 0</option> <option value="1">Option 1</option> <option value="2">Option 2</option> <option value="3">Option 3</option> <option value="4">Option 4</option> </select>
JS: $('#status').change(function() {
alert('status: ' + $('#status :selected').val());
});
When I change option i <select> nothing happens. Tested on FF 2.0.0.9, IE 6.0 Win XP Prof/WinXP Home
Change History
comment:2 Changed 5 years ago by BartekR
I'm sorry, I wasn't percise. I've made more tests, searched the tickets and I think it's error related to http://dev.jquery.com/ticket/1598 and http://dev.jquery.com/ticket/1698. I'm loading the script with $('#details).load(script.php) and the $('#status').change(function() {...) is inside script.php.
I think the ticket can be closed with status duplicate or sth.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Does the wiki example here not work for you?
http://docs.jquery.com/Events/change#fn
It works for me in FF 2.0.0.9 as well as IE6/7.