Electrolysis of sodium chloride solution with indicator