JavaScript Certificate Front End Certificate SQL Certificate Python Certificate PHP Certificate jQuery Certificate Java Certificate C++ Certificate C# Certificate XML Certificate FORUM ABOUT ACADEMY W3Schools is optimized for learning and training. Examples might be simplified to improve re...
Return Value: A Boolean.Returns true if the CTRL key was pressed when a mouse event occurs. Otherwise it returns false. DOM Version: DOM Level 2 Events.Browser Supportevent.ctrlKey is a DOM Level 2 (2001) feature.It is fully supported in all browsers:...
Using Event Helpers Some types of events are fairly common, and jQuery provides shorthand helper functions to make your code a little easier to write and read. Some examples: hover(): use this instead of mouseover and mouseleave events click(): listens for click events dblclick(): listens ...
JavaScript Certificate Front End Certificate SQL Certificate Python Certificate PHP Certificate jQuery Certificate Java Certificate C++ Certificate C# Certificate XML Certificate FORUM ABOUT ACADEMY W3Schools is optimized for learning and training. Examples might be simplified to improve re...
The horizontal screen pixel coordinate of the mouse pointer DOM Version: DOM Level 2 Mouse EventsMore ExamplesExample The differences between screenX and screenY and clientX and clientY: let sX = event.screenX; let sY = event.screenY; let cX = event.clientX; let cY = event.clientY; Try ...
Use thebutton propertyinstead Inherited Properties and Methods The MouseEvent inherits all the properties and methods from: The UiEvent The Event Object ❮ DOM Events❮ Event Objects Track your progress - it's free! Log inSign Up COLOR PICKER...
The metaKey Property The shiftKey Property The Mouse Event Object Syntax event.altKey Technical Details Return Value:A Boolean. Returnstrueif the ALT key is pressed when a mouse event occurs. Otherwise it returnsfalse. DOM Version:DOM Level 2Mouse Events. ...
1 : Left mouse button 2 : Right mouse button 4 : Wheel or middle button 8 : Fourth button (Browser Back) 16 : Fifth button (Browser Forward) For a left-hand configured mouse, the values are reversed. DOM Version:DOM Level 3 Events ...
DOM Version:DOM Level 3Mouse Events. More Examples Example Is the shift key breing pressed down? varx =event.getModifierState("Shift"); Try it Yourself » Related Pages HTML DOM reference:MouseEvent altKey Property HTML DOM reference:MouseEvent ctrlKey Property ...
JavaScript Events Syntax In HTML: <elementonmousemove="myScript"> Try it Yourself » In JavaScript: object.onmousemove=function(){myScript}; Try it Yourself » In JavaScript, using the addEventListener() method: object.addEventListener("mousemove",myScript); ...