

This is due to static electricity. It is the same phenomenon that causes you to shock yourself on the door knob after rubbing your feet on the carpet.
Nylon clothing crackles as you undress because of static electricity. This often builds up as you move around during the day or when the clothing comes out of the dryer.
