更新时间:2023-02-19 21:36:39
给出您不想影响的两个元素的特定ID:
Given the specific IDs of the two elements you don't want to affect:
$('img').not('#id1').not('#id2').addClass('myclass');
或:
$('img').not('#id1,#id2').addClass('myclass');
或:
$('img:not(#id1,#id2)').addClass('myclass');