With a electroscope electric charges can be detected. Thereby the attraction and repulsion of electric charges is utilized.
A electroscope consists of a metal ring, the housing and a vertical metal rod, where the connection of the electroscope and the pointer are attached. The housing and the metal rod are separated by an insulator .
At the beginning of the metal rod and the pointer of the electroscope are uncharged.
In the above experiment, the connection of the electroscope is touched with a positively-charged glass rod. Then there will be a charge equalization between the glass rod and the metal rod and pointer of the electroscope. That is the electrons travel to the glass rod. Thus, the pointer and the metal rod are positively-charged and repel each other.