Both isotopes of magnesium have 12 protons as shown by Mg's proton number in the periodic table.
By definition an isotope is an atom with the same number of protons but differs in its number of neutrons. As neutrons are neutral in charge the isotopes will have no difference in charge but different atomic weights. In this case 24Mg has 12 neutrons but 26Mg has 14 neutrons, this is because 24-12=12 and 26-12=14.