1 A.onmouseover = fn1; 2 a.onmouseout = fn2; 3 function Fn1 () { 4 div.classname = "Erweima Show" ; 5 } 6 function fn2 () { 7 div.classname =" Erweima hide "; 8 }
Parentheses are required whenever a function is called for execution.
A function is an object, and a function name is a pointer to that object.
The parentheses around the function name indicate that the code that executes the function is called immediately.
Using a function without parentheses is a pointer to an access function, not a function called.
The function return value is executed directly after the function name is appended with parentheses.
The function name corresponds to an event where the function name is assigned to the click, which is not appended to the function name, and is executed when the click event is triggered.
The difference between a function name and no parentheses in JS