cycling jQuery_Succinctly | Page 64

alert($('input:password').val()); alert($('input:radio').val()); alert($('input:reset').val()); alert($('input:submit').val()); alert($('input:text').val()); })(jQuery); Setting/getting the selected option of a select element Using the val() method, you can set the selected value of a element, use the val() method again to determine which option is selected. The val() method in this scenario will return the selected option's attribute value. Sample: sample60.html Setting/getting selected options of a multi-select element Using the val() method, you can set the selected values of a multi-select element by passing the val() method an array containing the corresponding values. 64