If Iran has the capability to do this (EMP attack) over the US, then we certainly have the same capability. Instead of Israel and/or the US striking Iran with bombs and nuclear power, killing masses of people, why would Israel or the US not make these enemies useless by launching EMPs over the rogue nations threatening to destroy Israel and the west such as Iran and Syria? I understand it would bring down all communication and technical systems setting countries back for decades. At least the people would have a fighting chance for survival.
I believe that the preemptive detonation of a nuclear weapon against another country is a violation of international law. They can only be used in retaliation for such an attack. This is why some nations secretly employ or support terrorists groups for things like this. It helps them to avoid accountability for attacks against civilian populations.
In Iran’s case, the nuclear production facilities are deep underground and would not be rendered inoperable by an EMP attack. Only the population living on the surface would be affected. Any attack by Israel or the US to cripple those facilities would be designed to minimize civilian casualties and would not involve weapons of mass destruction.