This study investigates how local environmental target constraints, a distinctive characteristic of Chinese environmental regulations, drive enterprises to improve their green innovation quality. We empirically examine the mechanism of the impact of the intensity of different types of local environmental target constraints on the quality of corporate green innovation utilizing the data of A-share listed companies in Shanghai and Shenzhen in China from 2011-2019 and each city's Government Work Reports. First, the strength of indirect environmental target constraints has a significant positive effect on the quality of green innovation, but further nonlinear characteristics reveal a significant inverse U-shaped relationship between them. However, direct environmental target constraint intensity had significant effects in improving enterprises' green innervation quality. Second, indirect environmental target constraint intensity has an inverted U-shaped trend in increasing the intensity of environmental regulation and influencing the digitalization of enterprises, which in turn forms an inverted U-shaped relationship with the quality of green innovation. Under indirect environmental goal constraint intensity, the increase in R&D expenditure for green innovation quality improvement decreases the expected net income, resulting in insufficient incentive for innovation, which explains the marginal decreasing trend of the positive impact of indirect environmental goal constraints on the quality of green innovation. Third, indirect environmental target constraint intensity works better in areas with policies prioritizing city over province and with mayors less than 57 years old. Therefore, local governments should establish an environmental target constraint system based on indirect environmental target constraints complemented by direct environmental target constraints, and assess and report the performance of indirect environmental targets in the subsequent Government 3 Work Report. Further reforms should streamline administration, decentralize power and improve services, cultivate more young and knowledgeable cadres, encourage communication and exchange between governments and enterprises, and implement market-oriented environmental regulations and measures such as emission trading mechanisms.