How to check whether the META key pressed when event is fired using jQuery ? Last Updated : 06 Jun, 2023 Comments Improve Suggest changes Like Article Like Report jQuery is a feature-rich JavaScript library. It is a fast and most used JavaScript library. Before using jQuery you must have a basic knowledge of HTML, CSS, and JavaScript. 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. The different operating system, it is located at 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. Example: In this example, we are using the above-explained method. HTML <!doctype html> <html lang="en"> <head> <style> h1 { color: green; } body { background-color: lightgreen; text-align: center; } div { padding: 20px; } p { font-size: 25px; } button { background-color: #4CAF50; /* Green */ border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; } </style> <script src= "https://code.jquery.com/jquery-3.5.0.js"> </script> </head> <body> <h1>GeeksForGeeks</h1> <p> Click here to check whether Meta key was pressed of not. </p> <button value="Test" name="Test" id="check"> click Here!! </button> <h1 style="color:black;" id="display"> **** </h1> <script> $("#check").click(function (event) { $("#display").text(event.metaKey); }); </script> </body> </html> Output: 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. Comment More infoAdvertise with us Next Article How to check whether the META key pressed when event is fired using jQuery ? V volumezero9786 Follow Improve Article Tags : Web Technologies JQuery jQuery-Questions Similar Reads How to check whether the event namespace is used in jQuery ? The jQuery is lightweight, and it has a lot of features like HTML/DOM manipulation, CSS manipulation, HTML event methods, effects and animations, AJAX, utilities. Many multinational companies like Google, IBM, and Microsoft use the jQuery library in their application. The event.namespace property re 1 min read How to make a key fire when key is pressed using JavaScript ? In JavaScript, holding down a key will fire the key continuously until it is released. This behavior may be used in applications such as games where a key may be expected to fire only once even after being held down. This can be achieved using two methods: Method 1: Using a flag variable to check th 3 min read How to find out which Character Key is Pressed using JavaScript? To find which key is pressed in JavaScript, use event listeners like keydown, keypress, or keyup. By accessing properties such as event.key or event.code, it becomes easy to identify the specific key pressed. This approach is useful for handling user input and triggering actions based on key events. 2 min read How to run the code on keypress event using jQuery ? In this article, we will see how to run the code snippet on the keypress event using jQuery. The keypress event is triggered when the keyboard button is pressed by the user. Syntax: $(selector).keypress() In the below example, we are creating a textarea element and when the user starts pressing a ke 1 min read How to Check if Enter Key is Pressed in Textbox JavaScript/jQuery ? Given a textarea element, the task is to check the user presses the enter key with the help of JQuery. jQuery keyup() MethodThis method triggers the keyup event or adds a function to run when a keyup event occurs. The keyup event occurs when a keyboard key is released. Syntax: Trigger the keyup even 2 min read Like