api.jquery.com icon indicating copy to clipboard operation
api.jquery.com copied to clipboard

Document changes in boolean attributes treatment

Open mgol opened this issue 1 year ago • 2 comments

See https://github.com/jquery/jquery/pull/5452

mgol avatar Mar 18 '24 22:03 mgol

The table in .attr( attributeName ) will need a new row for 4.0+, and .attr( attributeName, value ) will need updates to document the acceptability of a false value and its removal behavior which is similar to null behavior except with "aria-" attributes.

Proposed text for the latter:

Note: because ARIA attributes frequently associate behavior with "false" values that differs from attribute absence, passing false as the value for an attribute whose name starts with "aria-…" will stringify that value to "false" rather than remove the attribute. To guarantee removal of an attribute, provide null as the value or use the .removeAttr() method.

gibson042 avatar Mar 19 '24 15:03 gibson042