Switched to getAttribute instead of accessing className directly.