In aqueous electrolysis, the less reactive element discharges at the cathode. Hydrogen is produced unless there is a less reactive metal, in which case the said metal is produced. Oxygen is produced at the anode unless the solution contains halide ions, in which case halogen molecules are produced.