Why do H and F form a covalent bond, while Na and Cl form an ionic bond?

Isn't H a nonmetal?

Look at the difference in electronegativies.

Thanks. I read ahead a few pages and found what I wanted to know.

H and F form a covalent bond because they both have similar electronegativities. When H and F atoms come close together, the electronegativity difference is not large enough for one atom to completely take electrons from the other. Instead, they share electrons to achieve stability.

To determine whether a bond is covalent or ionic, you can compare the electronegativities of the atoms involved using the Pauling scale. Elements with similar electronegativities (a difference of less than 1.7 on the Pauling scale) tend to form covalent bonds.

On the other hand, Na and Cl form an ionic bond because Na has a low electronegativity (around 0.9), while Cl has a high electronegativity (around 3.0). The difference in electronegativities is large, so Cl has a strong attraction for electrons. Na easily loses one electron to become positively charged (Na+), while Cl readily gains an electron to become negatively charged (Cl-). These charged ions attract each other, resulting in an ionic bond.

To determine whether a bond is ionic or covalent, you can compare the electronegativity difference between the atoms. If the difference is greater than 1.7 on the Pauling scale, the bond is generally considered ionic.