Skip to main content

Bug Tracker

Side navigation

#8796 closed bug (duplicate)

Opened April 07, 2011 02:53AM UTC

Closed November 18, 2011 03:17PM UTC

Last modified November 18, 2011 03:17PM UTC

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

Reported by: spoonlikesham@gmail.com 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.

Attachments (0)
Change History (4)

Changed April 07, 2011 01:55PM UTC by rwaldron comment:1

component: unfiledevent
priority: undecidedlow
resolution: → invalid
status: newclosed

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

Changed November 18, 2011 03:17PM UTC by dmethvin comment:2

resolution: invalid
status: closedreopened

Changed November 18, 2011 03:17PM UTC by dmethvin comment:3

resolution: → duplicate
status: reopenedclosed

Changed November 18, 2011 03:17PM UTC by dmethvin comment:4

Duplicate of #3827.