Bug Tracker

Opened 6 years ago

Closed 6 years ago

#14300 closed bug (duplicate)

it has not effect use attr to change a checkbox after second times

Reported by: aiqunfang@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:

Description

the following code has effect in 1.8.3, but has not effect in 1.9.1 and 1.10.2.

A copy of code at http://jsfiddle.net/WyVaS/.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript" src="jquery-1.8.3.js"></script>
<script type="text/javascript">
    $(function () {
        $("#checkA").attr({ checked: true }); // will be checked

        $("#checkB").attr({ checked: true }); // will be checked
        $("#checkB").attr({ checked: false }); // will be unchecked

        $("#checkC").attr({ checked: true }); // will be checked
        $("#checkC").attr({ checked: false }); // will be unchecked
        $("#checkC").attr({ checked: true }); // will be checked, has effect in 1.8.3, but has not effect in 1.9.1 and 1.10.2

        $("body").append("<div>checkA.checked:" + checkA.checked + "</div>"
            + "<div>checkB.checked:" + checkB.checked + "</div>"
            + "<div>checkC.checked:" + checkC.checked + "</div>");
    });
</script>
</head>
<body>
<div><input id="checkA" type="checkbox" /> checked</div>
<div><input id="checkB" type="checkbox" /> unchecked</div>
<div><input id="checkC" type="checkbox" /> checked, has effect?(has effect in 1.8.3, but has not effect in 1.9.1 and 1.10.2)</div>
</body>
</html>

Change History (1)

comment:1 Changed 6 years ago by timmywil

Resolution: duplicate
Status: newclosed

Duplicate of #13573.

Note: See TracTickets for help on using tickets.