Electromagnets are another kind of magnet. They only work when electricity is running through them. An electric current makes a magnetic field. If you wrap the wire into a coil, the electrons spin around the coil and make a stronger magnetic domain.