Here's why:
* Sodium (Na) is the element responsible for the yellow color. When heated, sodium atoms get excited and release energy in the form of light, specifically at wavelengths corresponding to yellow light.
* Chlorine (Cl), the other component of sodium chloride, doesn't contribute significantly to the color.
Other metal salts can produce different colored flames, but sodium chloride is the most common and well-known for its bright yellow flame.