When We Shuffle Our Feet On Carpet, How Does Electricity Appear?
In this situation we are experiencing static electricity, or the buildup of electric charges on an object.
Electric charges are carried by electrons. When we shuffle our feet on the carpet, we are rubbing electrons off the carpet and onto our body.
When we then touch a metal doorknob, for example, the extra electrons jump from our body to the metal, making a spark.
Source: http://sce.e-smartonline.net