An ionic bond forms between two ions of opposite charges. In ionic bonding, electrons transfer from one atom to another. The elements take on either a negative or positive charge.
Ions are another name for charged atoms. Some elements are electropositive, and some are electronegative. Electropositive elements such as metals like to give up electrons, thus taking on a positive charge. Electronegative elements such as chlorine attract electrons, so they become negative. When electropositive and electronegative atoms meet and exchange ions, they take on opposite charges. Because positive and negative charges attract, these charged atoms become attracted to one another. This attraction forms an ionic bond that keeps the ions together.