Answer:
when the direction of the Current changes.
Step-by-step explanation:
Electromagnet refers to an iron ore wrapped around with a coil of wire, in presence of electric current. As it acts like a magnet, when current is passed through it.
The north & south poles of magnetic fields produced by such magnet, change with direction of current passed through it.