As weird ideas go in the history of science, it probably cannot get weirder than this. Or so it might seem to us today, since we have been taught that during electrolysis, water is broken down into its constituents - hydrogen and oxygen. It was far less obvious in the early years of the 19th century.
At that time, there was an intense ongoing debate about the nature of water. The followers of Antoine Lavoisier's new system of chemistry believed that it was a compound. According to the chemists who still believed in the phlogiston theory of burning, water was an element.
The 'progressive' chemists faced a very difficult problem. They were unable to satisfactorily explain why oxygen and hydrogen formed so far away — at a distance of several inches — from each other during electrolysis. The theory of ionic dissociation of electrolytes was still several decades in the future.
Johann Wilhem Ritter, who rejected Lavoisier's new system, found an ingenious way to resolve this problem. If only one could accept that water was an element. He argued that electrolysis was not a decomposition as the Lavoisierians believed, but a synthesis. According to Ritter, there were two separate processes happening at each electrode. At the positive electrode, water combined with positive electricity to form oxygen, and at the negative electrode, it combined with negative electricity to form hydrogen. Ritter imagined oxygen and hydrogen as two compounds of water with the two types of electricity.
Ritter's theory did not find much traction among chemists, but they were also unable to refute it. It simply did not catch on. Even though it might seem far-fetched, Ritter was not all that wrong. We know today that there are two independent reactions happening at the two electrodes during electrolysis.