For example sodium chloride is ionic compound and strong electrolyte and dissociates in water on hydrated sodium cations and chlorine anions:
NaCl(aq) → Na⁺(aq) + Cl⁻(aq).
In water, oxygen is negative and attract the positive ions of sodium, hydrogen is positive and attract the negative ions of chlorine.