The example in this article describes the JS method of switching the background color of a specified area by clicking on the color block. Share it with everyone for your reference. The specific implementation method is as follows:
希望本文所述对大家的javascript程序设计有所帮助。