![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the role of Keyboard Event shiftKey Property in JavaScript?
The altkey property is used to show whether SHIFT key is pressed or not when key event was triggered.
Example
You can try to run the following code to learn how to implement shiftKey property in JavaScript.
<!DOCTYPE html> <html> <body> <input type = "text" onkeydown = "funcShiftKey(event)"> <div id = "res">Press any key</div> <script> function funcShiftKey(event) { var val = document.getElementById("res"); if (event.shiftKey) { val.innerHTML = "SHIFT key: Pressed"; } else { val.innerHTML = "SHIFT key: NOT Pressed"; } } </script> </body> </html>
Advertisements