When my son was 12 months he started biting me out of the blue, the third time was when l was carrying him downstairs after a nap, he bit me so hard on my shoulder that l had a welt for 2 weeks!!
It hurt so much l actually dropped him!..he landed on his bottom with a thud on the (carpeted) stair, he just looked at me horrified. I said never bite anyone agin and stomped past him holding my shoulder in tears...l just couldn't help it as he had hurt me so much....( he was only 2 stairs up so quite safe)
2 minutes later he came up to me and mumbled a, sorry mummy...he was an early talker..
Not my finest moment but he never bit again...
Not recommending this though!!!
On a more serious note, showing you are upset, with a cross face, putting them in a place they don't want to be, ie travelcot and ignoring is a good option.
I have a lovely friend whose DD used to hit her for attention relentlessly, (she was 4)my friend used to keep smiling even though it must have hurt, and gently saying please don't do that...to no avail.
Once l saw her hit her dad for attention in the same way and he grabbed her by the arms, turned her firmly to face him, scowled, and told he sternly to never hit again or he would put her to bed at 5pm without a story or snack.
She never did hit him again according to my friend, who eventually did the same.