Hydrogen bond in liquid water and ice is a dynamic attraction between one hydrogen atom and two oxygen atoms of a neighboring water molecule. In hydrogen bonding, a proton is shared by two lone electron pairs while the oxygen nucleus attracts electrons better than the hydrogen nucleus. The hydrogen atoms are not only covalently attached to their oxygen atoms but also attracted towards nearby oxygen atoms.