In JavaScript event response, in many cases we need to obtain the event source object to change its properties, such as changing the src attribute of img. There are two ways to obtain the event source in the event response function:
The first way:
Directly pass it in as a parameter. For example,