Actually the hydrogen bond is simply a type of attraction which is caused by the the electronegativity difference between hydrogen and highly electronegative element like oxygen carbon nitrogen and fluorine.
Intermolecular hydrogen bonding takes place between two molecules having hydrogen and electronegative element. Hydrogen is attracted by the electronegative element of another molecule for example in case of HCl, H atom is attracted by Cl of another molecule, which in turn is attracted by the H of anther molecule. So in such a way they keep on attracting.
Intramolecular Hydrogen bonding :- in this case the hydrogen atom is attracted by the electronegative element of the same molecule in this case the hydrogen bonding takes place in a single molecule and not with the adjacent molecule , for example in case of orthonitrophenol, the H -atom of hydroxyl group is attracted by the nitro group. And shows intramolecular hydrogen bonding as shown below.
Points to note :-
1. In case of intermolecular hydrogen bonding the boiling and melting point of the the compound increases due to attraction between the molecules.
2. But in case of intramolecular hydrogen bonding the boiling and melting point of compound do not change as there is attraction inside the molecule not with the other molecule or any adjacent molecule.