Identify the elements in each compound: H2O consists of hydrogen (H) and oxygen (O), both nonmetals. MgCl2 consists of magnesium (Mg), a metal, and chlorine (Cl), a nonmetal. NaCl consists of sodium (Na), a metal, and chlorine (Cl), a nonmetal. CaO consists of calcium (Ca), a metal, and oxygen (O), a nonmetal.