Since cramps are the result of dehydration and a buildup of lactic acid -- a by-product of overworked muscles -- you can help prevent them by having your child follow the basic rules of healthy exercise: Eat complex carbs beforehand (bananas and pasta are kid-favorite eats), drink plenty of water, and warm up and cool down before and after play when possible (strolling to and from the playground, for instance).
If your child gets a cramp anyway, treat it with:
Have him sit down with his legs elevated for at least five minutes or until the cramp subsides. This will help blood circulate more easily to the muscle and wash away the lactic acid. Read him a book or turn on some music or a video to keep him from popping up.
Place a warm compress on the affected area for a few minutes at a time. Continue doing this until the cramp disappears.
To ease a leg cramp, rub the muscle up and down rather than side to side. For calf cramps, have your child flex his foot, pointing his toes toward his knees.
If a cramp lasts longer than an hour, call your doctor to make sure the pain isn't due to something more serious, such as a stress fracture.