Cl, Br and I belong to group 17(VII A) of the periodic table. Although the total number of electrons varies in these elements, they all contain 7 valence electrons.
A group in the periodic table consists of elements which have the similar properties and the same number of valence electrons. Valence electrons in an element take part in the reactions and hence elements with the same number of valence electrons display similar properties.