A hand turning on an electric stovetop
Read This Before Using Cast Iron On An Electric Stove
You can use cast iron with an electric stove so long as you're mindful of the differences that arise when compared to a natural gas burner. With electric burners, patience is key.
Since it takes a while for the coils to heat up, it will take longer for your cast iron to come to temperature. Lifting the cast iron as it heats will slow it even further.
While cast iron can potentially scratch a glass top range, you can prevent this by carefully lifting your cast iron instead of sliding it around the surface.
If you leave your cast iron skillet undisturbed atop an electric range, the even heating of the eye will render a pan that is thoroughly heated with less-pronounced hot spots.