Only 2 problems with that though.
The batteries themselves rely on rare earth elements such as cobalt and lithium that are massively polluting to produce and are often obtained using large amounts of child labour in some of the poorest countries in the world.
And the electrical power doesn't appear in the car by magic - it has to be generated
somewhere, so unless it is coming entirely* from 'renewables' (wind, solar etc for which the turbines and panels are also polluting to produce) then it is coming from gas/oil/nuclear/coal.
*as previously stated, it's extremely rare that 'renewables' provide very much of electrical supply. At time of writing it is an overcast, still, day so 'renewables' are only giving us around 32% of our supply.
https://grid.iamkate.com/
View attachment 66813