just like that the screen is 1920*1080 then the browser is at position 100,100 then the dom is at postion 100,100 of the browser so how can i get the dom's position of screen maybe 202,400 since the browser has border and title,so the dom's screen position is lager than 100+100 such as left is 100+100+2(border) 100+100+200(title of browser) so how can I get the dom's screen position by js here is the example picture example picture
You can use the screenX and screenY properties of a mouse event.
document.addEventListener('mousemove', (event) => console.log("Screen position (x,y): (" + event.screenX + ", " + event.screenY + ")"));
Move the mouse here and check console output.
See here for the details https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/screenX