javascript onclick select coordinates

var x;
var y;
if (e.pageX || e.pageY) { 
  x = e.pageX;
  y = e.pageY;
}
else { 
  x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; 
  y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; 
} 
x -= gCanvasElement.offsetLeft;
y -= gCanvasElement.offsetTop;

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
js click at coordinates click on specific coordinates javascript js onclick coordinates javascript onclick get coordinates javascript how to click coordinates javascript click coordinates javascript coordinates of click javascript click get coordinates of click click at coordinates javascript click on coordinates javascript javascript click on coordinates javascript onclick listener take x e y clicked canvas mouse click position javascript canvas click coordinates find the location of a click javascript canvas mousedown get uielement c# get canvas onmouse click canvas on mouse click not giving right co coordinates how to auto click on a rect location in js canvas pass mouse position window.click canvas at coordinate window.click canvas cordinet can you get mouse position on mouse click in js x y w h for canvas onclick javascript coordinates of where you clicked on image js javascript get coordinates of mouse click on canvas mousevent on body get coords how to get clicked elment position in javascript canvas get possition of point js get where you clicked on an element mouse position get canvas coordinates javascript on mouse events get mouse coordinates inside a div or an canvas with an image mousecliked event displau cords click on specfic point html onclick get position javascript how to record click position in js js position click handle x and y of canvas click coordinates javascript get coordinates on click canvas onclick x y js get mouse click canvas coordinates javascript position clicked set x y coordinates display coordinates on click event js canvas event listener mouse click extract datetime js getting left offset clicking on a canvas js click on position in embed java script click on a coord get mouse position on click click event get offset scroll detect click position get position of a div javascript onclick canvas click x y onclick click position how to get four clicked mouse position javascript click cordinates Make a small canvas (200px x 200px) component that can display the position of two mouse clicks. click on particular location javascript click on particular coordinates javascript how to get x and y of ceratin elemnt of canvas coordinates of elem js canvas knoe voordinates of elem js canvas how to get coordinates mouse get canvas coordinates javascript canvas determine mouse x y position on click canvas onclick coordinates html canvas click coordinates with javascript get click position in canvas canvas get click javascript ar get client x event click get x y coordinates mouse click in angular 8 get last click position in angular 8 find page x and y position of a canvas' origin find page x and y position of a canvas client click canvas get mouse click javascript canvas get coordinates(event) canvas get mouse click position get click x y javascript js event get end of x canvas get location on canvas where mouse click javascript get coordinates of two points on mouse click in html get mouse click on canvas typescript detect mouse click on image drawn on canvas get mouse click coordinates javascript mouseevent click get clicked element in canvas get position of element javascript onclick javascript mouse click position with respect to canvas get document click location javascript javascript mouse click on canvas make editable js get click position on element find coordinates of event clicked on div how to make canvas respond to scroll js like mouseclick renderer2 get coordinates click javascript canvas get mouse location on click find coordinates using onclick javascript canvas detect mouse click coordinates javascript onclick select coordinates
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source