HTML DOM | KeyboardEvent altKey Property Last Updated : 06 Jul, 2022 Comments Improve Suggest changes Like Article Like Report The KeyboardEvent altKey property in HTML DOM is a read-only property and used to return the boolean value which indicates the alt key is pressed or not. It returns True if alt key is pressed otherwise return false. Syntax: event.altKey Below program illustrates the KeyboardEvent altkey property in HTML: Example: This example check whether the "ALT" key is pressed or not. html <!DOCTYPE html> <html> <head> <title> HTML DOM KeyboardEvent altKey property </title> </head> <body> <h1>GeeksforGeeks</h1> <h2>KeyboardEvent altKey Property</h2> <p> Check whether the alt key is pressed or not </p> <input type="text" onkeydown="keyboard(event)"> <p id = "test"></p> <!-- script to check alt key event --> <script> function keyboard(event) { var a = document.getElementById("test"); if (event.altKey) { a.innerHTML = "The ALT key has been pressed!"; } else { a.innerHTML = "The ALT key has not been pressed!"; } } </script> </body> </html> Output: Before Press the Key: After Press the key: Supported Browsers: The browser supported by KeyboardEvent altKey property are listed below: Opera 12.1Internet Explorer 9Google Chrome 1Edge 12Firefox 1.5Apple Safari 1.2 Comment More infoAdvertise with us S Shubrodeep Banerjee Follow Improve Article Tags : Web Technologies HTML HTML-DOM Similar Reads HTML DOM Location hostname Property The Location hostname property in HTML is used to return the hostname of the current URL. The Location hostname property returns a string that contains the domain name, or the IP address of a URL. Syntax: It returns the hostname property. location.hostname It is used to set the hostname property. lo 1 min read HTML DOM Location href Property The Location href property in HTML is used to set or return the complete URL of the current page. The Location href property can also be used to set the href value point to another website or point to an email address. The Location href property returns a string that contains the entire URL of the p 2 min read HTML | DOM Input Image Object The Input Image Object in HTML DOM is used to represent the HTML < input > element with type=âimageâ. This tag is used to access or create the element. This element can be accessed by using getElementById() method. Syntax: document.getElementById("MyImage"); Return Value: It return the propert 3 min read HTML | DOM Ol start Property The DOM Ol start property is used to set or return the value of the start attribute in an ordered list. The start attribute in HTML is used to specify the start value for numbering the individual list item. It is used with an ordered list. Syntax: It is used to return the start property. olObject.st 2 min read HTML | DOM Option disabled Property The DOM Option disabled Property is used to set or return whether the value of an option would be disabled or not. The disabled attribute for the element in HTML is used to specify that the option value is disabled. A disabled option is un-clickable and unusable. It is a boolean attribute. Syntax: I 2 min read HTML | DOM KeyboardEvent keyCode Property The KeyboardEvent keyCode property is used for returning the Unicode character code of the key that has been used to trigger an onkeypress event. The KeyboardEvent keyCode property is also used for returning the Unicode character code of a key that has triggered an onkeydown or onkeyup event. The ke 2 min read HTML DOM InputEvent The input event is fired when the user changes an element, the value of an element or <textarea> element. DOM InputEvent occurs when an element in the HTML document gets input from the user. InputEvent property: data: Returns the inserted characters.dataTransfer: Returns an object containing i 2 min read HTML | DOM Parameter Object The Parameter Object in HTML DOM is used to create and access the <param> element with in the object.Parameters for plugin embedded with an element is done by using the element. Syntax: It is used to access a <param> element.var x = document.getElementById("myParam");It is used to create 2 min read HTML | DOM Link Object HTML DOM Link Object is used to access HTML <link> element.Syntax: To Access a HTML element: document.getElementById("myLink"); To Create a New HTML element: document.createElement("LINK"); Property Values: ValueDescriptioncharsetIt assigns the character encoding of the linked documentcrossOri 2 min read HTML DOM Style quotes Property The Style quotes Property in HTML DOM is used to set/return the type of quotation marks for embedded quotations. This element can be accessed by using getElementById() method. Syntax: To get the property.object.style.quotesTo set the property.object.style.quotes = "none | string string string string 2 min read Like