ZnO doped with a few per cent of magnetic ions such as Ni, Fe, Co exhibits room temperature ferromagnetism (RTFM), transforming it into a very promising candidate for future spintronic applications. Two samples i.e. ZnO doped with Ni and Cr (5% each) have been investigated in the present work. The samples were characterized by Rietveld refinement of X-ray diffraction (XRD) patterns and the superconducting quantum interference device (SQUID) magnetometry. Rietveld analysis confirms that both the polycrystalline samples possess wurtzite structure with no evidence of any secondary phase. The SQUID measurements exhibit a diamagnetic state for the pristine ZnO and a paramagnetic state for the as-synthesized (Cr and Ni)-doped ZnO samples. However, the post annealing in H2 and vacuum drive them to a remarkable ferromagnetic state at room temperature. No element specific signature for ferromagnetism was seen. Then the X-ray photoelectron spectroscopic (XPS) measurements were performed to investigate their electronic structure and exploring the origin of ferromagnetism in these diluted magnetic semiconductor materials. The XPS results confirm the creation of oxygen vacancies upon Hydrogen/ vacuum annealing, owned to the (Ni/Cr) 3d¬−O 2p hybridization. The findings suggest oxygen vacancies as the intrinsic origin for ferromagnetism in doped ZnO. The important feature of this work is that the ferromagnetism and the consequent electronic property changes are found to be reversible with regard to re-heating the samples in air, showing a switch “on” and “off” ferromagnetic ordering in the ZnO matrix.