For example, when sodium and chlorine atoms react to form sodium chloride, the sodium atom donates one electron to the chlorine atom. This creates a sodium ion (Na+) and a chloride ion (Cl-). The sodium ion is positively charged, and the chloride ion is negatively charged. The electrostatic attraction between the sodium ion and the chloride ion holds the sodium chloride compound together.