The electronic structures and optical properties of single-layer MoS2 with Tc doping, P doping and Tc-P doping were calculated by density functional theory (DFT) of the first-principles pseudo potential wave method. The calculated results show that element doping can change the electron structures of single-layer MoS2 near the Fermi surface and shift the conduction bands to the direction of low energy. Single-layer MoS2 is a direct-band-gap semiconductor with the band gap from K-point into Γ-point, respectively. The single-layer MoS2 is converted to a p-type semiconductor and the band gap value is reduced by P-doping. The single-layer MoS2 is converted to a n-type semiconductor and the band gap value is increased by Tc-doping. The sigle-layer MoS2 of Tc-P codoping is modulated to the intrinsic semiconductor of better performance for a n-type and a p-type semiconductor modulation with each other. The transition strength is reduced and moved to the direction of low energy by doping.