When the current is switched on through a wire, a compass needle kept nearby gets deflected from its north-south position. Explain.
A) Due to electric field
B) Due to magnetic field
C) Due to gravitational field
D) Due to nuclear field