Crochet a band that reaches the handle
Chain the height you want plus one. Starting in the second chain, work a row of US single crochet, then chain one and turn. Repeat in even rows until the two short ends sit on either side of the handle. Hold the band against the mug as you work so you can stop before the ends overlap.
Add the loop after testing the button
Fasten off, weave in the tails, and sew a button to the center of one short edge. Join yarn at the center of the other short edge and chain a loop large enough to go over the button. Slip stitch back into the attachment point, fasten off, and weave in the ends. Test that the mug sits flat with its handle easy to grip.
