Training your puppy or dog to stop biting your ankles, feet and clothing is first accomplished by understanding why your dog bites ankles, feet, or clothing in the first place.
Generally you will experience this behavior problem with dog breeds that have higher prey drives and have been selectively bred to chase, nip, bite, or hold something as part of their work. When this is the case, anything that is moving may trigger this response. Fast moving children or a robe gliding across the floor may be irresistible to this instinct.
A different reason for this behavior will be if a dog is resource guarding and you happen to walk too close to what the dog is guarding. This can be anything from a resting place, bone, toy, or a person.
You can differentiate these two reasons for biting ankles and clothing mostly by the evidence of the scenario and the types of bite. When the biting seems more like rough play and the dog or puppy is really latching on and chasing it is most likely triggered by a high prey drive instinct. When the biting seems more aggressive/serious and ends when you are away from a guarded resource – it is most likely resource guarding.
If the bites seem aggressive and somewhat sneaky when a guest is in the home you may want to look up fear aggression.
If it is due to rough play and high prey drive this unwanted behavior is easily resolved when you follow the Foundation Style Dog Training System. Concentrate on leadership exercises first. Then, be sure to replace the behavior with an appropriate outlet, by studying habitation and the drive balance section. Lastly, polish off with true obedience to easily command the dog to "leave it" or redirect with another command when the dog decides to bite ankles or clothes. A full plan will form new habits quickly.