How does An Electroscope Work?

An electroscope is a charge-detecting device which is based on the principle that objects charged at the same polarity will physically repel each other.With the help of this principle it is used to detect the presence and magnitude of electric charge.