<html> <body> <button style="position:absolute; left:10; top:10;" onclick="alert(event.x);"> The x coordinate of your pointer when you click this button is! </button> </body> </html>