An electromagnet is a temporary magnet which behaves like a magnet when an electric current is passed through the insulated copper wire and loses its magnetism when current is stopped.