No law needed, once the government stop subsidizing oil diesel and gas vehicles will be as expensive to drive as they are in other countries and electric will start to look a lot more attractive.
And the oil price will have to skyrocket.
I live in Australia where we pay A$1.40 per litre (US$5.80 per US gallon) and we've got an A$0.37 per litre fuel excise (as well as a 10% GST, included in the price). The pre tax price of petrol is under A$1 per litre. So petrol isn't that expensive. Even in the UK where they have even more tax on petrol (what we pay in Aussie dollars, they pay in UK Pounds) it isn't prohibitively expensive to keep a car in fuel.
Meanwhile, electric vehicles are twice the cost of equivalent ICE vehicles and have a limited shelf life as the battery packs will degrade over 10 years. Also there's the cost of electricity, the A$0.22 per KW/h rate will easily double if just half of drivers buy a plug in vehicle.
Beyond that, no-one is buying them because the range is terrible and recharging takes several times longer than the drive to deplete the battery. 10 hours to charge and 100 KM to deplete. Petrol will need to be 4 times its current price to make this alternative better.