Rock-Type
Electric Pokemon will have trouble defeating a rock-type Pokemon with electric moves. The electric attacks will not have any effect on rock Pokemon. Even if your electric Pokemon does know some moves that are not electric-type (it's possible to teach some electric-type Pokemon moves that are not electric-type), rock-type moves will have a strong effect against your electric Pokemon. Rock Pokemon include Geodude, Onyx and Rhydon. Moves to look out for include rock tumbler, ancient power and rollout. Rock-type Pokemon are common in caves and occasionally populate tall grass.
Ground-Type
Much like rock-type Pokemon, ground-type Pokemon will not suffer damage when confronted with an electric attack. Their ground-type attacks will be extra effective against your electric-type Pokemon, though. Some ground-type Pokemon include Sandshrew, Cubone and Phanpy. Some powerful ground-type moves include earthquake, magnitude and fissure. You will most likely find ground-type Pokemon in areas such as tall grass and caves, so set your electric-type Pokemon as reserve party members when exploring in areas known to have ground-type Pokemon.
Mixed Electric-Type
Some electric Pokemon have more than one type (for example, Zapdos is flying-type and electric-type at the same time), so it can either help defend them or open them up for more damage. Steel- and flying-type Pokemon, when mixed with electric-type Pokemon, are doubly susceptible to damage from ground- and rock-type Pokemon. Water-, fire-, grass- and ice-type Pokemon will have a higher built-in defense than a pure electric-type Pokemon since those secondary types are strong against rock- and ground-types.
Defenses
You can take steps to help protect your electric-type Pokemon from ground- and rock-type Pokemon. It's always a good idea to teach your Pokemon a wide range of moves. Water- and plant-type moves are strong against ground- and rock-type Pokemon. By teaching your electric Pokemon moves that can quickly take down a rock- or ground-type Pokemon, it is less likely that the opposing Pokemon will have time to inflict much damage. Moves that increase defense can also benefit your electric-type Pokemon in a fight against a ground- or rock-type.