HTML | DOM TouchEvent altKey Property Last Updated : 13 Jun, 2022 Comments Improve Suggest changes Like Article Like Report The TouchEvent altKey property is a read-only property and used for returning a Boolean value which indicates whether or not the "ALT" key was pressed when a touch event was triggered. The TouchEvent altKey property mostly returns false because generally, touch devices do not have an alt key. Syntax : event.altKey Return Value: It returns true if the alt key is pressed, else it returns false. Below program illustrates the TouchEvent altKey property : Example: Finding out whether the "ALT" key was pressed on the touch screen or not. html <!DOCTYPE html> <html> <meta name="viewport" content="width=device-width, initial-scale=1"> <head> <title>TouchEvent altKey property in HTML</title> <style> h1 { color: green; } h2 { font-family: Impact; } body { text-align: center; } </style> </head> <body ontouchstart="isKeyPressed(event)"> <h1>GeeksforGeeks</h1> <h2>TouchEvent altKey property</h2> <br> <p>Touch somewhere in the document and wait for an alert to tell if the ALT key was pressed or not.</p> <script> function count(event) { // Check whether the ALT key has been pressed // or not. if (event.altKey) { alert("ALT key has been pressed!"); } else { alert("ALT key has not been pressed!"); } } </script> </body> </html> Output: Before clicking the button: After clicking the button: Supported Browsers: Google Chrome 22 and aboveEdge 79 and aboveFirefox 52 and aboveOpera 15 and above Comment More infoAdvertise with us S Shubrodeep Banerjee Follow Improve Article Tags : Web Technologies HTML HTML-DOM HTML-Property Similar Reads HTML DOM Style textAlign Property The HTML DOM style textAlign property is similar to the text-align property in the CSS. It sets the alignment for the inner content of a block element using HTML DOM. SyntaxWe can use textAlign in two different ways, one to set the alignment, and the other to get the current alignment. Get the valu 3 min read HTML | DOM Style visibility Property The Style visibility property in HTML DOM used to set the visibility for an element. It is used to hide or show the element. It returns the visibility property that is given to an element. Syntax: It returns the visibility property.object.style.visibilityIt is used to set the visibility property. ob 2 min read HTML DOM Style transitionProperty Property The Style transitionProperty property in HTML DOM used to set the name of the CSS property for the transition effect. It can occur when a user hover over an element. It returns the transitionProperty property of an element. Syntax: It returns the transitionProperty property. object.style.transitionP 2 min read HTML | DOM Style position Property The position property sets or returns the type of positioning method used by the element. It may be static, relative, absolute or fixed. Syntax: Return position syntax: object.style.position Set position syntax: object.style.position = "static | absolute | fixed | relative | sticky | initial | inher 4 min read HTML | DOM Style textDecorationLine Property The Style textDecorationLine property in HTML DOM used to set the decoration for a line. We can specify any number of decorations for a line. It returns the decoration that is given to the text. Syntax: It returns the textDecorationLine property. object.style.textDecorationLineIt is used to set the 2 min read HTML | DOM Style borderImageSlice Property The borderImageSlice property is used to specify the inward offsets of the image border. The user can specify the value of this property in terms of percentage, number or global values. Syntax: object.style.borderImageSlice = "number|%|fill|initial|inherit" Return Values: It returns a string value, 3 min read HTML | DOM Style clear Property The DOM Style clear property in HTML is used to set or get the position of the specific element relative to floating objects. Syntax To get clear property:object.style.clearTo set clear property:object.style.clear = "none|left|right|both|initial|inherit" Properties Value: valuedescriptionleftDoes no 2 min read HTML DOM Table Object The HTML DOM Table object represents an HTML <table> element in the Document Object Model (DOM). It provides properties and methods to manipulate tables, such as adding or deleting rows and columns, accessing individual cells, or modifying the table's structure dynamically.Syntax:To access tab 3 min read HTML | DOM MouseEvent offsetX Property The MouseEvent offsetX property is a read-only property which is used for returning the x-coordinate of the mouse pointer, relative to the target element. Syntax : event.offsetX Return Value: It returns a number which represents the horizontal coordinate of the mouse pointer, in pixels. Below progra 1 min read HTML | DOM Style columns Property HTML DOM Style columns Property is used to set the width of the column & column count. Syntax: To Return the column property: object.style.columns To Set the column property: object.style.columns= "auto|columnwidth columncount| initial|inherit" Property Values: Auto: Sets both values of width 2 min read Like