js选中select function selected(id, val) { $('#' + id + ' option[value="' + val + '"]').attr('selected', true); }