<select name="sel">
<option value="A">英语</option>
<option value="B">汉语</option>
<option value="C" selected="selected">德语</option>
<option value="D">法语</option>
</select>
1)获取当前下拉框的value和labels
2)设置下拉框中“法语”选中
3)注册下拉框onchange事件,并输出选中后的值
$(document).ready(
function() {
//获取当前值及label
alert($("select option:selected").val() + ","+ $("select option:selected").text());
//指定默认选项
$("select option:nth-child(4)").attr("selected", true);
//绑定onchange事件
$("select").change(function(){
if($("select option").is(":selected")){
alert("you select the value is "+$(this).val());
}
});
//获取选中项的值和label
$("select option").click(function() {
alert($(this).val() + "," + $(this).text());
});
});