diff --git a/entries/val.xml b/entries/val.xml index 52f2023f..2c78771f 100644 --- a/entries/val.xml +++ b/entries/val.xml @@ -11,7 +11,7 @@ Get the current value of the first element in the set of matched elements. -

The .val() method is primarily used to get the values of form elements such as input, select and textarea. In the case of select elements, it returns null when no option is selected and an array containing the value of each selected option when there is at least one and it is possible to select more because the multiple attribute is present.

+

The .val() method is primarily used to get the values of form elements such as input, select and textarea. When the first element in the collection is a select-multiple (i.e., a select element with the multiple attribute set), it returns an array containing the value of each selected option, or null if no options are selected. When called on an empty collection, it returns undefined.

For selects and checkboxes, you can also use the :selected and :checked selectors to get at values, for example:


 // Get the value from a dropdown select