You are tasting the sodium ions.
One way this works is that there is a protein called ENaC that forms a tiny pore to allow sodium ions to enter a neuron. Normally, the inside of a neuron is negatively charged relative to the outside. When sodium enters, this negative charge is reduced. When it gets reduced enough, the neuron "fires" an action potential, signalling to the brain that salt is present.
The pore is shaped so that ions other than sodium ions have trouble going through. Potassium ions and lithium ions, which are similar in size, can fit, so those ions taste salty too (though not as salty as sodium). Anions like chloride, even if they can fit through the pore, don't trigger an action potential because they increase the membrane potential of the neuron instead of decreasing it.
This is not the whole story of salty tastes in humans. There's apparently another kind of salt receptor that doesn't rely on ENaC, but much less is known about it. The other receptor may be more important than the ENaC receptors, at least for conscious awareness of the "salty" taste.