我有很多选择器,我需要在脚本中多次操作它们。
到目前为止,我已经这样做了:
var allSelectors3 = $('#icon20,#icon21,#icon22,#icon23,#icon24,#icon25,#icon26,#icon27,#icon28,#icon29,#icon30,#icon31,#icon32');
var allSelectors2 = $('#icon12,#icon13,#icon14,#icon15,#icon16,#icon17,#icon18,#icon19');
var allSelectors = $('#icon2,#icon3,#icon4,#icon5,#icon6,#icon7,#icon8,#icon9,#icon10,#icon11');
$(allSelectors).show();
$(allSelectors2, allSelectors3).hide();
这是最好的方法吗?