JavaScript/Working with the Mouse

From Wikibooks, open books for an open world
Jump to: navigation, search
Previous: W3C Event Handlers Index Next: Forms

JavaScript Console Tests[edit]

Test x,y

window.onmouseover = function(){document.title = [event.x,event.y];};

Test offsetX,offsetY

window.onmouseover = function(){document.title = [event.offsetX,event.offsetY];};

Test clientX,clientY

window.onmouseover = function(){document.title = [event.clientX,event.clientY];};

Test pageX,pageY

window.onmouseover = function(){document.title = [event.pageX,event.pageY];};

References[edit]

Further reading[edit]


Previous: W3C Event Handlers Index Next: Forms