When you comb dry hair tiny electronics are knocked off the atoms in the comb as it rubs past. The effect is that your hair is coated with these tiny negative electrical charges and so is attracted to anything that has the normal amount of electrons, or less. An electrical charge built up like this called 'static' because it does not move. You could try rubbing a balloon to stick it to the wall.
img source: http://www.healthywomen.org/content/article/hair-brushing-mistakes