Add class name to affected elements