<select id="select1"> <optgroup label="Swedish Cars"> <option value ="volvo">Volvo</option> <option value ="saab">Saab</option> </optgroup> <optgroup label="German Cars"> <option value ="mercedes">Mercedes</option> <option value ="audi">Audi</option> </optgroup> </select> jQuery("#select1 option:selected").text();
Volvo
Saab
Mercedes
Audi
jQuery("#select1 option:selected").text();
时间: 2025-01-13 10:38:20