No, but since you're using jQuery anyway, you can use that. This will add the statusBox
class to the elements with the IDs statusBox25
, statusBox75
, and statusBox100
:
$("#statusBox25, #statusBox75, #statusBox100").addClass('statusBox');
Alternatively, if you want to remove all of the existing classes and replace them all with statusBox
like your original code as doing, you could use this:
$("#statusBox25, #statusBox75, #statusBox100").attr('class', 'statusBox');
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…