The invention discloses a preparation method of a metal-nonmetal-codoped nano-titanium dioxide photocatalyst. The method comprises the following steps of: a, adding modified polyacrylonitrile fibers to TiCl4 solution, standing for 0.1-2h, heating up to 30-80 DEG C, carrying out heat preservation for 1-10h, filtering, washing with distilled water until the solution is neutral, drying to constant weight, thereby obtaining nitrogen-doped modified nano-titanium dioxide; and b, feeding the prepared nitrogen-doped modified nano-titanium dioxide to a metal ion solution, impregnating for 0.1-2h, filtering, and drying to constant weight so as to obtain the product. Compared with the prior art, materials prepared by the method are rapid in dye wastewater degradation speed, free of secondary pollution, simple in preparation process, low in operation cost, firm in combination with fibers, unlikely to drop, easy to recover, and simple to recycle.