Modify ↓
Ticket #8796 (closed bug: duplicate)
Executing .click() on a checkbox performs actions out of order
| Reported by: | spoonlikesham@… | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | event | Version: | 1.5.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
A code sample says 1000 words:
<input type="checkbox" onclick="alert(this.checked?'yes':'no')" id="test" />
Pretty simply unchecked checkbox. Clicking on it will check it and then alert "Yes"
However, doing the same thing with jQuery:
$('#test').click()
Excutes in the opposite it order. It will alert "No", and then check the checkbox.
Suspect the FIRST action should be to change the checked status, followed by onclick() and other Click events.
Change History
comment:1 Changed 2 years ago by rwaldron
- Priority changed from undecided to low
- Resolution set to invalid
- Status changed from new to closed
- Component changed from unfiled to event
comment:2 Changed 18 months ago by dmethvin
- Status changed from closed to reopened
- Resolution invalid deleted
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.

jQuery cannot be accountable for the event firing order in the presence inline event handlers