退而求其次, 用Double Click 選全Group:
$(document).ready(function(){
$("optgroup").on("dblclick", function() {
$(this).children("option").prop("selected", "selected");
$(this).next().children("option").prop("selected", false);
$(this).prev().children("option").prop("selected", false);
});
}); |