My son is 22 months old and has been hitting our cat when he gets in a rambunctious mood. Firm tones of voice often elicit laughter from him. I am assuming this is attention-seeking behaviour. Do we handle this the same way as though he is hitting, let's say, another child? Our cat NEVER responds aggressively.
You're lucky that the cat doesn't respond aggressively, as cat scratch fever can be serious. I think you are correct to handle it as though he were hitting another child. And the cat will help you. Like other children who quickly learn to stay out of reach of a hitter, the cat will come to avoid your son.
Incidentally, I doubt that hitting the cat is attention-getting behaviour. My guess would be that he is just “trying out” a new response and enjoying his newly acquired power as an advanced toddler. A little boy his age feels that he is king of the hill and that the cat, like all his other subjects, should exist for his own pleasure. Talk to him about it (“_____ doesn't like to be hit”), and let him stand beside you and participate when you hold and stroke the cat.
Our parenting advice is given as suggestions only. We recommend you also consult your healthcare provider, and urge you to contact them immediately if your question is urgent or about a medical condition.