Iron is used as an electromagnet in a junkyard. Electromagnet is a temporary magnet. It behaves like a magnet as long as current is passed through it. The poles of an electromagnet can be changed by changing the direction of supplying current. Iron especially soft iron is used as an electromagnet because it loses all its magnetism when the current supply is stopped. But with steel it's
so. Because when steel is used as an electromagnet and current is passed through it, it becomes a permanent magnet. Which means when the current supply is stopped, steel still behaves like a magnet having its poles (North and South) fixed.