Hydrogen vs. Battery Electric Cars

Why can’t the hydrogen cars be chargeable? They could just store the water they produce/have a water tank you fill up and then electrolyze that and retain only the hydrogen (this makes it much easier since you’d only be compressing one gas with no possibility of an explosion since you can keep the anode far away from the cathode). A hydrogen fuel cell is just a battery. 

Sure, this would take a few extra components, but it’s not microchip design. If we ran out of petroleum tomorrow, a design like this would immediately provide a solution that doesn’t sacrifice range for most people and has all the benefits of an EV. You could charge it at home or at a hydrogen station or at an outlet, depending on whichever was available.