Fairy-lock

In folklore, fairy-locks (or elflocks) are the result of fairies tangling and knotting the hairs of the sleeping children as they play in and out of their hair at night.
English tradition.
The concept is first attested in English in Shakespeare's "Romeo and Juliet" in Mercutio's speech of the many exploits of Queen Mab, where he seems to imply the locks are only unlucky if combed out:
Therefore, the appellation of elf lock or fairy lock could be attributed to any various tangles and knots of unknown origins appearing in the manes of beasts or hair of sleeping children.
It can also refer to tangles of elflocks or fairy-locks in human hair. In King Lear, when Edgar impersonates a madman, "elf all my hair in knots."(Lear, ii. 3.) What Edgar has done, simply put, is made a mess of his hair.
See also "Jane Eyre", Ch. XIX; Jane's description of Rochester disguised as a gypsy: "... elf-locks bristled out from beneath a white band ..."
German tradition.
German counterparts of the "elf-lock" are "Alpzopf", "Drutenzopf", "Wichtelzopf", "Weichelzopf", "Mahrenlocke", "Elfklatte", etc. (where alp, drude, mare, and wight are given as the beings responsible). Grimm, who compiled the list, also remarked on the similarity to Frau Holle, who entangled people's hair and herself had matted hair. The use of the word "elf" seems to have declined steadily in English, becoming a rural dialect term, before being revived by translations of fairy tales in the nineteenth century and fantasy fiction in the twentieth.
French tradition.
Fairy-locks are ascribed in French traditions to the lutin.
Eastern European tradition.
In Poland and nearby countries, witches and evil spirits were often blamed for Polish plait. This can be, however, a serious medical condition or an intentional hairstyle.