AC motors work a slightly different way: they pass alternating current through opposing pairs of magnets to create a rotating magnetic field, which "induces" (creates) a magnetic field in the motor's rotor, causing it to spin around. You can read more about this in our article on AC induction motors.