Roll up a newspaper and when he grabs your ankles, flog him with the newspapers with the firm command NO until he lets go. It doesn't hurt, but the noise seemed to have spooked mine. She only bit me a couple of times.......after that she would grab her rawhide chew and put it on top of my feet....

It is a puppy thing so be patient. Once the dog responds to the newspaper and stops biting, be sure and praise him. Maybe even a puppy treat to reward him for stopping. This worked for me.
Hope this helps!