- 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 shiftKey Mouse Event in JavaScript?
The shiftkey mouse event property is used to show whether SHIFT key is pressed or not when mouse button is clicked.
Example
You can try to run the following code to learn how to implement shiftKey Mouse event in JavaScript.
<!DOCTYPE html> <html> <body onmousedown = "funcShiftKey(event)"> <div>Press and hold SHIFT key and then click here.</div> <script> function funcShiftKey(event) { if (event.shiftKey) { alert("SHIFT key: Pressed"); } else { alert("SHIFT key: NOT Pressed"); } } </script> </body> </html>
Advertisements