How to check whether the META key pressed when event is fired using jQuery ?
In this article, we will learn about how you can check whether the META key was pressed when the event fired JQuery.
META key – It is a special key that is located next to the space-bar on the keyboard. For the different operating system, it is located at a different location example –
- Windows – The META key maps to the Windows key.
- Macintosh – the META key maps to the Command key (⌘).
event.metaKey – It will return a boolean value (true or false) that indicates whether the META key was pressed at the time the event fired or not.
Before clicking the button – There is only one button named ‘click me please!’.
After clicking the button – After clicking the button if you see true then it indicates that you did press a meta key but in case, you can notice that your output is false it indicates that you didn’t press any meta key.
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.