This is true! The coils of an electromagnetic is connected to a battery of the other sources of an electric current. As an electric current flows throughout the wire inside the electromagnetic, a magnetic field would be also produced inside of the coil.