After running the code to move the position of the mouse at will, you can display the mouse coordinates, do not occupy system resources
JS get the mouse coordinates, get the typical example of the mouse pixel, run this page, move the mouse at will, the location of the mouse can be displayed in due time, do not occupy the system resources. <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <html xmlns=" http://www.w3.org/1999/xhtml "> <head> <title> JavaScript gets mouse coordinates </title> <meta http-equiv= "Content-type" content= "text/html"; charset=gb2312 "/> <style type=" text/css "> tip { width:200px; the border:2px #ddd; nbsp padding:8px; background: #f1f1f1; color: #666; } </style> <script type= "text/ JavaScript "> function Mousepos (e) { var x,y; var e = e| | window.event; return { X:e.clientx+document.body.scrollleft+document.documentelement.scrollleft, y:e.clienty+document.body.scrolltop+document.documentelement.scrolltop }; }; function test (e) { document.getElementById ("MJs"). InnerHTML = Mousepos (e). x+ ', ' +mOusepos (e) .y; }; </script> </head> <body> <div id= "MJS" class= "tip "> Source Enthusiasts </div> <div id=" test "style=" Width:1000px;height:1000px;background: #ccc; "Onmousemove=" Test (event) "></div> </body> </html> [Ctrl + a full election note: If you need to introduce external JS need to refresh to perform