.. ( )
There are times when you want to know which element caused the event and what the event is. And more information .. In your example, e.keycodeit is useful to determine which key was pressed.
There are many methods in this argument, such as preventDefault()to prevent the behavior of the default event or e.targetto get the target that triggered the event. Therefore, you need to pass the argument e as a parameter to the function.
If you do not require it, just do not pass it as an argument
source
share