# event.pageX

## event.pageX ( ) Returns: Number version added: 1.0.4

Description: The mouse position relative to the left edge of the document.

## Examples:

#### Example: Show the mouse position relative to the left and top edges of the document (within this iframe).

    <!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <title>css demo</title>

      <style>

      body {
        background-color: #eef;
      }
      div {
        padding: 20px;
      }

      </style>

      <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    </head>
    <body>

    <div id="log"></div>

    <script>

    $( document ).on( "mousemove", function( event ) {
      $( "#log" ).text( "pageX: " + event.pageX + ", pageY: " + event.pageY );
    });

    </script>

    </body>
    </html>

#### Demo: