Electrolysis of sodium chloride solution
The electrolysis of molten NaCl indeed gives elemental sodium and chlorine gas:

$\ce {2NaCl (l) -&gt; 2Na (l) + Cl2 (g)}$

However, in solution (namely aqueous solution such that you are doing the electrolysis on a solution of NaCl in water), the highly reactive Na produced reacts instantly with water to give sodium hydroxide, hence why no solid Na is ever observed.