Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to get mouse x and y in javascript

document.addEventListener("mousemove", () => {
  let mousex = event.clientX; // Gets Mouse X
  let mousey = event.clientY; // Gets Mouse Y
  console.log([mousex, mousey]); // Prints data
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: number to char js 
Javascript :: exclude node_modules from tree command 
Javascript :: bootstrap modal title center 
Javascript :: : Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout.Error: 
Javascript :: regex for number and letters 
Javascript :: br in react native 
Javascript :: node get all files in folder 
Javascript :: update version of node gyp 
Javascript :: add leading zeros to number javascript 
Javascript :: jquery check if empty object 
Javascript :: jquery loop through array 
Javascript :: radio button onchange jquery 
Javascript :: js object to querystring 
Javascript :: html5 store object in localstorage 
Javascript :: jquery remove string from string 
Javascript :: set value in span using javascript 
Javascript :: document ready function 
Javascript :: make react app 
Javascript :: onclick open modal jquery 
Javascript :: javascript get element width 
Javascript :: Appium click on element Javascript 
Javascript :: get html attribute value in js 
Javascript :: localsstorage array append element 
Javascript :: select element by id js 
Javascript :: socket io with cors 
Javascript :: jquery select on select 
Javascript :: generate otp using javascript 
Javascript :: npm check updates 
Javascript :: Hide a div on clicking outside it with jquery 
Javascript :: jquery set attribute stack overflow 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =