Electromagnetic waves are periodic changes of electric and magnetic fields in space and time. They propagate at the speed of light. At any point of a light beam, the magnetic field is always perpendicular to the electric field. Therefore, for the sake of clarity, only the electric field is shown in the animations here. Both the electric and magnetic fields oscillate in a plane perpendicular to the direction of propagation of the light beam.
In the following movies, a wave propagating in space is visualized. The light beam is intersected at a fixed point of space by a plane perpendicular to the direction of propagation of the light beam. At the point of intersection, the electric field is measured and shown as a vector in the pictures. In other words, the length and direction of the vector represents the strength and the direction of the electric field measured at the starting point of the vector. Don’t interpret these pictures as showing waves located in space! The light beam is not spread laterally. (Source)