example === true

jQuery is not being used to set the checkbox here. This is to show that the native behavior of a checkbox as it is changed by the user does not keep the attribute up to date with the current value, just the property.

1.6.1 fixed compatibility

Changing boolean attributes with .attr() changes the property (still better to use .prop())

.attr() can be used on the window/document (just defers to .prop())

Note: Node properties such as selectedIndex, nodeName, tagName, and defaultValue are no longer retrievable with .attr(), but can now be retrieved with .prop().

The value attribute is not what you think it is.

To retrieve and set the current value of an input, you need the value property

$input.prop('value'); // Current value
$input[0].getAttribute('value'); // Default value
$input.attr('value');
// Right now, retrieves the property, but this will be deprecated in 1.7.
$input.val(); // Hey, there's a whole method devoted to value!

Summary

Use the .attr() method for attributes and the .prop() method for properties. Often, they will be the same value, but if you want
any current values, meaning if it can change with user interaction, use prop.
In cases where it doesn't make a difference, prop will be faster.

The Future of Attributes and Properties

We are discussing deprecating the boolHook in jQuery 1.7 for removal in 1.8

Also, the value attrHook and tabIndex attrHook ( this will fix Sizzle bugs as well )

Gravitating towards a fully consistent API: .attr() for attributes and .prop() for properties