As per the jQuery API, val() handles select elements with the multiple attribute by setting and getting arrays of strings, toggling the selection of multiple options. For non-select elements, val() concatenates array items.
Additionally, setting the value for non-multiple select elements now only activates the first matching option, whereas previously all options with the duplicate value would be selected.
As per the jQuery API,
val()
handlesselect
elements with themultiple
attribute by setting and getting arrays of strings, toggling the selection of multipleoption
s. For non-select
elements,val()
concatenates array items.Additionally, setting the value for non-multiple
select
elements now only activates the first matchingoption
, whereas previously alloption
s with the duplicate value would be selected.Added docs and tests, which have passed.