HTML | DOM KeyboardEvent shiftKey Property Read Courses Improve Improve Improve Like Article Like Save Article Save Report issue Report The KeyboardEvent shiftKey property in HTML DOM is a read-only property and used to return a Boolean value which indicates the SHIFT key is pressed or not. The KeyboardEvent shiftKey property returns true if the SHIFT key is pressed, otherwise returns false. Syntax: event.shiftKey Below program illustrates the KeyboardEvent shiftkey Property in HTML DOM: Example: This example check whether the SHIFT key is pressed or not. html <!DOCTYPE html><html> <head> <title> HTML DOM KeyboardEvent shiftKey Property </title> </head> <body> <h1>GeeksforGeeks</h1> <h2>KeyboardEvent shiftKey Property</h2> <p> Check whether the SHIFT key is pressed or not </p> <input type="text" onkeydown="keyboard(event)"> <p id="test"></p> <!-- script to check shift key is pressed or not --> <script> function keyboard(event) { var a = document.getElementById("test"); if (event.shiftKey) { a.innerHTML = "The Shift key has been pressed!"; } else { a.innerHTML = "The Shift key has not been pressed!"; } } </script></body> </html> Output: Before Press the key: After Press the key: Supported Browsers: The browser supported by KeyboardEvent shiftKey Property are listed below: Opera 12.1Internet Explorer 9Google Chrome 1Edge 12Firefox 1.5Apple Safari 1.2 Last Updated : 06 Jul, 2022 Like Article Save Article Previous HTML | DOM Form target Property Next HTML | DOM Form length Property Share your thoughts in the comments Add Your Comment Please Login to comment...