He wants your attention and like most young kids doesn't care if it's negative attention or positive attention.
Do you still have a playpen? If so, set it up, don't put any toys in it. When he does this, plop him in the playpen, tell him firmly "NO HITTING", and turn your back on him. You don't have to leave his sight but do not interact with him at all, no eye contact, no talking, nothing. Leave him there for a minute then pick him up and hug him and say "Hitting someone is wrong. It hurts. Let's find something fun to do instead." Don't use his crib for this. His crib should be a calm, happy place for sleeping.
As he approaches 18 months, you can lengthen it to 1.5 mintues, then 2 minutes at 2 years, etc.
Be consistent and he'll get it. Then he'll start testing to see if you really mean it. : )
at 12:04 PM on Feb. 6, 2009