Bug Tracker

Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#8796 closed bug (duplicate)

Executing .click() on a checkbox performs actions out of order

Reported by: [email protected] Owned by:
Priority: low Milestone: 1.next
Component: event Version: 1.5.1
Keywords: Cc:
Blocked by: Blocking:

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 (4)

comment:1 Changed 11 years ago by Rick Waldron

Component: unfiledevent
Priority: undecidedlow
Resolution: invalid
Status: newclosed

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

comment:2 Changed 10 years ago by dmethvin

Resolution: invalid
Status: closedreopened

comment:3 Changed 10 years ago by dmethvin

Resolution: duplicate
Status: reopenedclosed

comment:4 Changed 10 years ago by dmethvin

Duplicate of #3827.

Note: See TracTickets for help on using tickets.