<p><code>val()</code> allows you to pass an array of element values. This is useful when working on a jQuery object containing elements like <code><input type="checkbox"></code>, <code><input type="radio"></code>, and <code><option></code>s inside of a <code><select></code>. In this case, the <code>input</code>s and the <code>option</code>s having a <code>value</code> that matches one of the elements of the array will be checked or selected while those having a <code>value</code> that don't match one of the elements of the array will be unchecked or unselected, depending on the type. In case of <code><input type="radio"></code>s that are part of a radio group and <code><select></code>s, any previously selected element will be deselected.</p>
0 commit comments