JavaScript MouseEvent ctrlKey Property Last Updated : 08 Feb, 2023 Comments Improve Suggest changes Like Article Like Report The mouseEvent ctrlKey property is used to define whether the ctrl key is pressed or not. It is a boolean value. When the ctrl key is pressed then on click of the mouse buttons it returns true and if it is not pressed then it returns false. Syntax: event.ctrlKey Return Value: It returns a boolean value indicating whether the ctrl key is pressed or not. true: it indicates the ctrl key is pressed.false: it indicates the ctrl key is not pressed. Example: In this example, we will see the example of MouseEvent ctrlKey property. html <body style="text-align:center;"> <h1 style="color:green;"> GeeksforGeeks </h1> <h2> mouseEvent ctrlKey Property </h2> <button onclick="geek (event);">Get Ctrl key state!</button> <p id="gfg"></p> <script> function geek (event) { if (event.ctrlKey) { document.getElementById("gfg") .innerHTML = "Ctrl key is pressed."; } else { document.getElementById("gfg") .innerHTML= ("Ctrl key is not pressed."); } } </script> </body> Output: Javascript MouseEvent ctrlKey PropertyJavascript MouseEvent ctrlKey Property Supported Browsers: The browser supported by the ctrlKey property are listed below: Apple SafariGoogle ChromeFirefoxOperaInternet Explorer Comment More infoAdvertise with us Next Article Must Do Coding Questions - Topic-wise V Vishal Chaudhary 2 Follow Improve Article Tags : JavaScript Web Technologies JavaScript-Properties Similar Reads Interview PreparationInterview Preparation For Software DevelopersMust Coding Questions - Company-wise Must Do Coding Questions - Topic-wiseCompany-wise Practice ProblemsCompany PreparationCompetitive ProgrammingSoftware Design-PatternsCompany-wise Interview ExperienceExperienced - Interview ExperiencesInternship - Interview ExperiencesPractice @GeeksforgeeksProblem of the DayTopic-wise PracticeDifficulty Level - SchoolDifficulty Level - BasicDifficulty Level - EasyDifficulty Level - MediumDifficulty Level - HardLeaderboard !!Explore More...Data StructuresArraysLinked ListStackQueueBinary TreeBinary Search TreeHeapHashingGraphAdvance Data StructuresMatrixStringAll Data StructuresAlgorithmsAnalysis of AlgorithmsSearching AlgorithmsSorting AlgorithmsPattern SearchingGeometric AlgorithmsMathematical AlgorithmsRandomized AlgorithmsGreedy AlgorithmsDynamic ProgrammingDivide & ConquerBacktrackingBranch & BoundAll AlgorithmsProgramming LanguagesCC++JavaPythonC#Go LangSQLPHPScalaPerlKotlinWeb TechnologiesHTMLCSSJavaScriptBootstrapTailwind CSSAngularJSReactJSjQueryNodeJSPHPWeb DesignWeb BrowserFile FormatsComputer Science SubjectsOperating SystemsDBMSComputer NetworkComputer Organization & ArchitectureTOCCompiler DesignDigital Elec. & Logic DesignSoftware EngineeringEngineering MathematicsData Science & MLComplete Data Science CourseData Science TutorialMachine Learning TutorialDeep Learning TutorialNLP TutorialMachine Learning ProjectsData Analysis TutorialTutorial LibraryPython TutorialDjango TutorialPandas TutorialKivy TutorialTkinter TutorialOpenCV TutorialSelenium TutorialGATE CSGATE CS NotesGate CornerPrevious Year GATE PapersLast Minute Notes (LMNs)Important Topic For GATE CSGATE CoursePrevious Year Paper: CS exams Like