An electromagnet is a type of magnet in which the magnetic field is induced by the flow of an electric current through a coil of wire. The magnetic field disappears when the flow of electricity is stopped.
Electromagnets have at least two advantages over permanent magnets:
The operation of an electromagnet is one aspect of electromagnetism.
One unusual use of an AC electromagnet is that it can be used to repair the damage to a cathode ray tubes screen caused by bringing a magnet next to them. The damage is caused by a magnet magnetizing pieces of iron (or whatever) inside the screen so the bend the path of the electrons distorting the image. The rapidly reversing polarity of an AC electromagnet will leave the magnetic domains of the screen in random directions, thus making them cancel out. This procedure is known as degaussing. Of course, you should never take a magnet next to a computer monitor in the first place.