Add class to elements

Hello,

Is there any code snippet that could help to add a class to multiple other classes or ids?