-
Notifications
You must be signed in to change notification settings - Fork 261
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:
checkboxandradio: check/uncheck based on whether or not their value is in the arrayselectelements: 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