/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function mouseDown(nsEvent) { // Support Mozilla browsers that use event passing to functions var theEvent = nsEvent ? nsEvent : window.event; var locString = "Screen X = " + theEvent.screenX + " Client X = " + theEvent.clientX + "\n"; locString += "Screen Y = " + theEvent.screenY + " Client Y = " + theEvent.clientY + "\n"; if ( theEvent.altKey ) { locString += " - Alt key pressed"; } console.log(locString); }