A gold-leaf electroscope can detect the presence of charge and test the kind of charge.
Gold leaf electroscope
The gold-leaf electroscope is used to detect, measure and find the nature of a charge. It consists of two thin strips (leaves) of gold attached to a metal rod suspended inside a glass jar. The mouth of the jar is fitted with a rubber stopper, through which the rod passes. The other end of the rod is attached to a metal disc. Some electroscopes have strips of silver, copper or brass instead of gold.
The purpose of the tin foil is to discharge the electroscope. When the leaf of the electroscope expands, they touch the tin foil. The tinfoil is connected with the help of the wire. Thus, there is the flow of charge from the tin foil to the Earth.