jQuery中典型的方法:
$('option[selected]')
不管用,因為selected並不是CSS標准。
因此,在zepto中想要獲取select元素中選中的option,需采取如下方法:
// get OPTION elements for which `selected` property is true $('option').not(function(){ return !this.selected })
或者推薦
$("#ID").val() //獲取選中的value
$("#ID option").eq($("#ID").attr("selectedIndex")).text() //獲取選中的文本值