Bug Tracker

Opened 11 years ago

Closed 11 years ago

#10143 closed bug (invalid)

Checkboxes can't be checked with .toggle(function, function)

Reported by: [email protected] Owned by:
Priority: low Milestone: None
Component: event Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:


When I click the checkbox on this page with my mouse the callbacks are fired but the checkbox isn't checked, I assume that preventDefault is being called somewhere but shouldn't be.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
        <input type="checkbox" id="foo" value="bar" name="baz" />
    <script type="text/javascript">
    $(document).ready(function() {
            function() {
                console.log('toggled 1');
            function() {
                console.log('toggled 2');

Change History (2)

comment:2 Changed 11 years ago by timmywil

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

This is the intended behavior. From the docs: "The implementation also calls .preventDefault() on the event, so links will not be followed and buttons will not be clicked if .toggle() has been called on the element."

Note: See TracTickets for help on using tickets.