Examples

Example. When mixed with water, hydrochloric acid [[$\text{HCl}$]] dissociates into hydrogen ions [[$\text{H}^+$]] and chloride ions [[$\text{Cl}^-$]]:
[[$$\text{HCl} \rightarrow \text{H}^+ + \text{Cl}^-$$]]
In this context, water acts as a base for the hydrochloric acid. Water molecules [[$\text{H}_2\text{O}$]] absorb the dissociated hydrogen ions [[$\text{H}^+$]] to yield hydronium ions [[$\text{H}_3\text{O}^+$]]:
[[$$\text{HCl} + \text{H}_2\text{O} \rightarrow \text{H}_3\text{O}^+ + \text{Cl}^-$$]]
Example. 
When mixing water solutions of hydrochloric acid [[$\text{HCl}$]] and sodium hydroxide  [[$\text{NaOH}$]], both ionic compounds dissociate into positive and negative ions:
[[$$\text{HCl} + \text{NaOH} \rightarrow \text{H}^+ + \text{Cl}^- + \text{Na}^+ +\text{OH}^-$$]]
In this context, the hydroxide in sodium hydroxide acts as the base for the hydrochloric acid. 
Each hydrochloric acid particle donates a hydrogen ion [[$\text{H}^+$]] to one sodium hydroxide particle. In simpler words, the acidic [[$\text{H}^+$]] and the basic [[$\text{OH}^-$]] combine to make water:
[[$$\text{H}^+ + \text{Cl}^- + \text{Na}^+ + \text{OH}^- \rightarrow \text{NaCl} + \text{H}_2\text{O}$$]]
As ions of opposite charge, the remaining sodium ions [[$\text{Na}^+$]] and chloride ions [[$\text{Cl}^-$]] associate to form sodium chloride [[$\text{NaCl}$]].