优化(缩短)这段代码的最佳方法是什么?我正在使用 Jquery UI 插件“选择菜单”分配给选定数量的元素。
$('footer#footer form select').selectmenu({
style: 'dropdown',
appendTo: 'footer#footer form span'
});
$('form.filters section.grid .industry select').selectmenu({
style: 'dropdown',
appendTo: 'form.filters section.grid .industry'
});
$('form.filters section.grid .subject select').selectmenu({
style: 'dropdown',
appendTo: 'form.filters section.grid .subject'
});
$('form.filters section.grid .year select').selectmenu({
style: 'dropdown',
appendTo: 'form.filters section.grid .year'
});
$('form.filters section.grid .organiser select').selectmenu({
style: 'dropdown',
appendTo: 'form.filters section.grid .organiser'
});