How does a crane use an electromagnet?

A crane or junkyard crane uses an electromagnet to pick magnetic items up. The crane controls the electromagnet by using a a circuit that has a wire wrapped around a piece of metal that can be magnetized that's at the end of the crane's arm. When the circuit completes, the metal at the end of the cranes arm gets temporarily magnetized. When the current stops, the metal get demagnetized and can't pick things up anymore.