We know that photon has no charge. Then where from it gets electric and magnetic field in light?
Malik Sajad asks
Electric and magnetic fields are not produced by the photon; it is massless too.
But, photon is created by time varying electric and magnetic fields, usually produced by accelerated charges.
As you might have already learnt, a charge at rest produces an electric field around it. A moving charge (current) produces a magnetic field around it as well as magnetic field. A varying current produces a varying magnetic field and hence an induce emf or current. An accelerated charge produces a time varying electric and magnetic fields.
Thus under suitable situations, the electric and magnetic fields can reinforce each other and propagate out as pure electromagnetic form of energy and such a packet of energy is called photon.