Closed
Description
The paragraph on https://api.jquery.com/val/#val-value starting with "Passing an array of element values" is inaccurate, and less clear than it could be. In actuality, we implement two similar but distinct special behaviors for array input, both effectively updating the affected collection to the intersection of provided input with possible values:
checkbox
andradio
: check/uncheck based on whether or not their value is in the arrayselect
elements: select/unselect options based on whether or not their value is in the array
Although jQuery does not directly touch elements outside the context collection, the .val
setter can affect them by triggering native behavior restricting to 1 the maximum count of checked radio inputs in a group or selected options in a select-one.
Metadata
Metadata
Assignees
Labels
No labels