Magnetism and electricity are very closely related. Temporary magnets can be created quite easily by passing an electric current through a coil of wire. The magnetism produced in this way is termed electromagnetism.
The magnetic field around an electromagnet is only there when current is flowing through the wires. When there is not current flow, there is no magnetic effect. When the current is reversed, the magnetic dipole of the electromagnet is reversed also. When the current flows one way, the magnet may have its north pole to the right and its south pole to the left. When the current is turned around, the north pole moves to the left and the south pole moves to the right.
The direction of the magnetic field around a wire can be predicted by the right hand grip rule. If you pretend to grip the wire with your right hand with your thumb pointing in the direction of the current, your fingers would curl around in the direction of the magnetic field.
The magnetic field around an electromagnet is only there when current is flowing through the wires. When there is not current flow, there is no magnetic effect. When the current is reversed, the magnetic dipole of the electromagnet is reversed also. When the current flows one way, the magnet may have its north pole to the right and its south pole to the left. When the current is turned around, the north pole moves to the left and the south pole moves to the right.
The direction of the magnetic field around a wire can be predicted by the right hand grip rule. If you pretend to grip the wire with your right hand with your thumb pointing in the direction of the current, your fingers would curl around in the direction of the magnetic field.