# How to find the coordinates of the cursor relative to the screen with JavaScript?

HTMLJavascriptProgramming Scripts

To find the coordinates of the cursor in JavaScript, use event.screenX and event.screenY.

## Example

You can try to run the following code to get cursor coordinates relative to the screen in JavaScript.

<!DOCTYPE html>
<html>
</html>