You need to be careful when adding the same events as the boxes inside the box.
Such as:
There seems to be no big problem from the surface, but there is a fatal problem, that is, every time you click on the box, the test will add a click event, and the added click event will not overwrite each other, it can be added multiple times, unless it is the same event, which will cause The Click event of test is executed several times during the subsequent click, similar to the second click Execution two times, the third click executes three times ...
So you need to use only one event ().
one()The function is used to bind one-time event handlers for each of the events that match an element .
The simplest approach is to:
Alternatively, before adding a click event to test, remove the Click event that he already has, either off or unbind, and the Unbind bottom is also implemented using off.
Add Event (jquery)