What are the prerequisites in hydrogen bonding?
Actually, theoretically speaking hydrogen bond is the attractive force between the hydrogen attached to an electronegative atom of one molecule and an electronegative atom of a different molecule. Usually the electronegative atom is oxygen, nitrogen, or fluorine, which has a partial negative charge. A hydrogen bond may occur between $\ce{H-O}$, $\ce{H-N}$, $\ce{H-F}$ (first two are more common). Apart from that, these hydrogen-bond attractions can occur between molecules (intermolecular) or within different parts of a single molecule (intramolecular)

See also the Wikipedia article about hydrogen bonding
A hydrogen atom attached to a relatively electronegative atom will play the role of the hydrogen bond donor An electronegative atom such as fluorine, oxygen, or nitrogen will be the hydrogen bond acceptor, irrespective of whether it is bonded to a hydrogen atom or not. An example of a hydrogen bond acceptor that does not have a hydrogen atom bonded to it is the oxygen atom in diethyl ether.

http://chemwiki.ucdavis.edu/@api/deki/files/4680/image115.png?revision=1