An ionic compound is composed of ionic bonds that are formed by transfer of electrons from one atom to the other. The atom that loses electrons acquires a positive charge (cation) while that which gains electrons acquires a negative charge.
In the case of sodium chloride; Sodium Na has 1 electron in its outer orbital while Chlorine Cl has 7 electrons. Thus, Cl requires 1 electron to complete its octet. This electron is donated by Na.
Thus, NaCl is essentially, Na⁺Cl⁻
Ans D) Chlorine becomes an anion by gaining an electron from sodium