battery
Step-by-step explanation:
Electromagnets can be created by wrapping a wire around an iron nail and running current through the wire. The electric field in the wire coil creates a magnetic field around the nail. In some cases, the nail will remain magnetised even when removed from within the wire coil