Electron transfer in reaction between ammonia and hydrochloric acid $$\ce{NH_3 + HCl -&gt; NH_4Cl}$$

The electronic structure of ammonia is such so that the nitrogen atom has an outer shell with a lone pair of electrons.

When ammonia reacts with hydrochloric acid (above), the hydrogen from the $\ce{HCl}$ moves to the ammonia. However, it leaves its electrons behind because there is already a lone pair of 2 electrons on the $\ce{N}$ atom, allowing it to retain a $\mathrm{1s^2}$ shell.

Why doesn't the hydrogen take its electron over and nitrogen doesn't then "donate" an electron to the chlorine?
Chlorine is the more electronegative species. It would thus retain the bonding electrons when the hydrogen is evicted. This hydrogen then forms a coordinate bond with the lone pair on nitrogen.