An electromagnet is a temporary magnet obtained by passing electric current through a wire coiled around a soft iron ( or steel). The soft iron core behaves like a magnet till the time current flows through the wire.
This concept is used in the electromagnetic crane.
For the construction please refer the answer posted by your friend.
@Rajnish: Good effort!! keep it up!!