  We study the variation of Selmer ranks of Jacobians of twists of
hyperelliptic curves and superelliptic curves. We find sufficient conditions
for such curves to have infinitely many twists whose Jacobians have Selmer
ranks equal to $r$, for any given nonnegative integer $r$. This generalizes
earlier results of Mazur-Rubin on elliptic curves.
