0
What is the purpose of e in this function parameter ? Please help.
I should be able to use clientX directly instead of e.clientX shouldn't I ? --here is the code -- document.addEventListener("mousemove",function(e){ console.log(e.clientX); });
5 RĂ©ponses
+ 2
The parameter (e) is automatically passed from javascript to you function when you add an event listener. It represents the element that was affected, an example would be the button element that was clicked
0
I don't understand
0
I didn't declare e...it should be working without parameter
0
Thanks for helping