Sibeesh Passion

Top Menu

  • Home
  • Communities
  • Search
  • About

Main Menu

  • Articles
    • Azure
    • JavaScript
    • Angular
    • Node JS
    • Web API
    • Career Advice
    • Interview
    • JQuery
    • Knockout JS
    • Jasmine Framework
    • Database
    • SQL
    • MongoDB
    • MySQL
    • Tools
    • IIS
    • Wamp Server
    • WordPress
    • Visual Studio
    • ASP.NET
    • MVC
    • PHP
    • SEO
    • HTML5
    • Office Development
  • Controls
    • HighChart
    • High Map
    • Ignite UI
      • igGrid
      • igDataChart
    • JQWidgets
      • JQX Grid
      • JQX List Box
    • Spire.Doc
    • Spire.XLS
  • My Contributions
    • Medium
    • ASP.NET Forum
    • C# Corner
    • Code Project
    • DZone
    • GitHub
    • JSFiddle
    • MSDN
    • Stack Overflow
  • Connect with Me
    • About Me
    • Facebook
    • Google Plus
    • Linkedin
    • Pinterest
    • Twitter
    • Quora
    • YouTube
  • Videos
  • Awards
  • SibeeshVenu.com
  • Home
  • Communities
  • Search
  • About

logo

Sibeesh Passion

  • Articles
    • Azure
    • JavaScript
    • Angular
    • Node JS
    • Web API
    • Career Advice
    • Interview
    • JQuery
    • Knockout JS
    • Jasmine Framework
    • Database
    • SQL
    • MongoDB
    • MySQL
    • Tools
    • IIS
    • Wamp Server
    • WordPress
    • Visual Studio
    • ASP.NET
    • MVC
    • PHP
    • SEO
    • HTML5
    • Office Development
  • Controls
    • Ignite_UI_Chart_Control

      Working With IgniteUI Chart igDataChart Control

      July 14, 2016
      0
    • Apply License Key

      Working With IgniteUI Grid Control

      July 10, 2016
      0
    • Grid with check box selection

      Implement radio button selection in JQWidgets JQXGrid using checkbox

      June 29, 2016
      0
    • High Chart

      Client Side Exporting In HighChart

      May 27, 2016
      0
    • Dynamically apply colour coding in Grid

      Dynamically Apply Colour Coding in Grid With Dynamic Headers And Data

      February 16, 2016
      0
    • Dynamically apply colour coding in Grid

      Remove Time Stamp Form Legend In HighChart

      January 25, 2016
      0
    • Select NuGet Package

      Using MVC Grid In MVC

      December 11, 2015
      0
    • Column values to a href

      a href Columns In Grid

      November 11, 2015
      0
    • Load Data On Scroll

      Load Data To Grid On Sroll

      November 2, 2015
      0
    • HighChart
    • High Map
    • Ignite UI
      • igGrid
      • igDataChart
    • JQWidgets
      • JQX Grid
      • JQX List Box
    • Spire.Doc
    • Spire.XLS
  • My Contributions
    • Medium
    • ASP.NET Forum
    • C# Corner
    • Code Project
    • DZone
    • GitHub
    • JSFiddle
    • MSDN
    • Stack Overflow
  • Connect with Me
    • About Me
    • Facebook
    • Google Plus
    • Linkedin
    • Pinterest
    • Twitter
    • Quora
    • YouTube
  • Videos
    • Bing Speech And Translate Text

      Webinar: Let us Build a Speech, Translation API using AZURE Bing Speech ...

      June 30, 2018
      0
    • Text Translator Api Thumbnail

      Video: Azure Cognitive Services Text Translator API

      June 30, 2018
      0
    • Bing Speech Api Thumbnail

      Video: Azure Cognitive Services - Bing Speech API

      June 30, 2018
      0
    • Video: 21 Easy Tips for Healthy Life

      February 22, 2018
      0
    • Azure Face API

      Webinar: Azure Cognitive Service Face API

      July 23, 2017
      0
    • Custom Stylish Handlebar Mirror in Royal Enfield Thunderbird

      June 25, 2017
      0
    • Wrapping Rope in Royal Enfield Crash Guard Or Bumper

      April 22, 2017
      0
    • How to Change Handlebar in Royal Enfield Thunderbird

      April 22, 2017
      0
    • Video: How to be a successful software engineer

      April 22, 2017
      0
  • Awards
  • SibeeshVenu.com
  • Create Your Own Cryptocurrency in Private Consortium Network Ethereum Azure Blockchain

  • Detect Noise Level Audio Decibels in MXChip Azure IoT DevKit

  • Deploy Angular App Using Azure DevOps Build and Release Pipelines

  • MXChip Device with Pressure, Humidity, Temperature Info using Azure IoT Workbench

  • Realtime IoT Data using Azure SignalR and Functions in Angular

ArticleJQuery
Home›Article›How to disable F12 Key in a page using JQuery

How to disable F12 Key in a page using JQuery

By SibeeshVenu
July 16, 2015
4796
2
Share:

Introduction

In this post, we will see how we can disable F12 Key option using simple JQuery code. I hope you will like it.

Background

As you know disabling F12 Key option or disable right click in our page, does not makes the content secured. Even though that is the reality, I am sharing this post to show how to disable the F12 Key in page.

Using the code

We are going to use JQuery for this requirement. So you need to load the JQuery reference first.

<script src="https://sibeeshpassion.com/content/scripts/jquery-1.11.1.min.js"></script>

Now we need to add the needful scripts.

<script>
			document.onkeypress = function (event) {
				event = (event || window.event);
				if (event.keyCode == 123) {
					return false;
				}
			}
			document.onmousedown = function (event) {
				event = (event || window.event);
				if (event.keyCode == 123) {
					return false;
				}
			}
			document.onkeydown = function (event) {
				event = (event || window.event);
				if (event.keyCode == 123) {
					return false;
				}
			}
		</script>

Here what we did is, whenever user press F12 , we are restricting that. We are applying this restriction to the entire document. And we use onkeypress ,onmousedown ,onkeydown event to do this requirement.

That is all. Everything is done and set. Now you need to see the output and demo right?

Demo

You can see a demo at Disable F12 Option Demo

You can see F12 option is not allowed in the demo page. You can always gives an alert also, if a user press F12.

Conclusion

I hope you liked my article. Now please share me your feedback. Thanks in advance.

Kindest Regards
Sibeesh Venu

TagsDisable F keysDisable F12 key using JQueryHow to disable F12 Key in a pageJQuery
Previous Article

How to disable right click in a ...

Next Article

How to use shortcode inside any php ...

0
Shares
  • 0
  • +
  • 0
  • 0
  • 0
  • 0

SibeeshVenu

I'm neither an expert nor a guru. I have been awarded Microsoft MVP 3times, C# Corner MVP 4 times, DZone MVB. I always love to learn new technologies, I believe the one who stops learning is old. You are always welcome to ask any doubts if you have any, I would be more than happy to help. Please feel free to follow me on any social media network, I really like to get connected with you.

Related articles More from author

  • Code SnippetsJQuery

    Find An Inner Div Which Has A Particular Attribute And Remove

    August 14, 2015
    By SibeeshVenu
  • Code SnippetsJQuery

    Read appsetting from a web config file in client side

    May 31, 2015
    By SibeeshVenu
  • Code SnippetsJQuery

    Delete an element from an array in jQuery using the index

    May 31, 2015
    By SibeeshVenu
  • ArticleHTML5

    Client Side Chart Widget in HTML5: Part 5 (Polar Area Chart)

    May 29, 2015
    By SibeeshVenu
  • ArticleCodeProjectJQuery

    Find And Exclude Element From Array

    August 5, 2015
    By SibeeshVenu
  • Line Chart With Custom Tool Tip
    ArticleHow toHTML5

    Client Side Chart Widget in HTML 5: Part 7 (Line Chart With Custom ToolTip)

    January 29, 2015
    By SibeeshVenu

2 comments

  1. Prasad 17 March, 2016 at 07:39 Reply

    this is failed with the below scenario…
    when open in new tab in FF the previous F12 page is also available for current restricted page…

    • Sibeesh Venu 22 March, 2016 at 04:44 Reply

      Thanks much for the feedback. I will look in to that 🙂

Leave a reply Cancel reply

0

MICROSOFT MVP (3)

profile for Sibeesh Venu - Microsoft MVP

Recent Posts

  • Create Your Own Cryptocurrency in Private Consortium Network Ethereum Azure Blockchain
  • Detect Noise Level Audio Decibels in MXChip Azure IoT DevKit
  • Deploy Angular App Using Azure DevOps Build and Release Pipelines
  • MXChip Device with Pressure, Humidity, Temperature Info using Azure IoT Workbench
  • Realtime IoT Data using Azure SignalR and Functions in Angular
  • IoTHubTrigger Azure Function and Azure IoT Hub
  • Azure Function as Output Job Topology of an Azure Stream Analytics Job
  • Azure Stream Analytics Job and Tools for Visual Studio
  • An Introduction to Azure Stream Analytics Job
  • Raspberry PI SD Card Provisioning with Windows 10 IoT Core – Adding Packages to the Existing FFU Image

Archives

  • January 2019 (4)
  • December 2018 (6)
  • November 2018 (8)
  • October 2018 (5)
  • July 2018 (4)
  • June 2018 (4)
  • May 2018 (2)
  • April 2018 (3)
  • March 2018 (4)
  • February 2018 (4)
  • January 2018 (1)
  • December 2017 (3)
  • November 2017 (3)
  • October 2017 (1)
  • September 2017 (2)
  • July 2017 (3)
  • June 2017 (3)
  • May 2017 (7)
  • April 2017 (9)
  • March 2017 (9)
  • February 2017 (2)
  • January 2017 (4)
  • December 2016 (2)
  • November 2016 (2)
  • October 2016 (1)
  • August 2016 (1)
  • July 2016 (7)
  • June 2016 (9)
  • May 2016 (11)
  • April 2016 (6)
  • March 2016 (14)
  • February 2016 (15)
  • January 2016 (11)
  • December 2015 (8)
  • November 2015 (16)
  • October 2015 (22)
  • September 2015 (11)
  • August 2015 (20)
  • July 2015 (27)
  • June 2015 (35)
  • May 2015 (51)
  • April 2015 (10)
  • March 2015 (9)
  • January 2015 (17)
  • December 2014 (5)
  • November 2014 (2)
  • October 2014 (3)
  • August 2014 (1)
  • July 2014 (1)
  • December 2013 (1)

Categories

  • Achievements (34)
    • Microsoft MVP (1)
  • ADO.NET (1)
  • Android (1)
  • Angular (26)
  • Arduino (2)
  • Article (255)
  • Article Of The Day (3)
  • ASP.NET (35)
  • Asp.Net Core (2)
  • Automobile (5)
  • Awards (8)
  • Azure (34)
    • Azure CDN (1)
    • Cognitive Services (3)
      • Translator Text (1)
    • Virtual Machine (4)
  • Blockchain (1)
  • Blog (14)
  • Browser (1)
  • C-Sharp Corner (17)
    • Monthly Winners (1)
      • October 2015 (1)
  • C# (19)
  • Career Advice (10)
  • Code Snippets (53)
  • CodeProject (31)
  • CSS (6)
  • CSS3 (5)
  • Database (36)
    • MongoDB (5)
    • MySQL (3)
    • SQL (28)
      • SSAS (2)
    • SQL Server (11)
  • Docker (2)
  • Drawings (1)
  • Excel Programming (3)
  • Fun (1)
  • How to (35)
  • HTML (5)
  • HTML5 (18)
    • Storage In HTML5 (2)
  • IIS (3)
  • Interview (6)
  • IoT (11)
  • JavaScript (15)
  • JQuery (77)
    • Exporting (1)
    • jQuery UI (1)
  • Json (7)
  • Knockout JS (2)
  • Linux (1)
  • Machine Learning (1)
  • Microsoft (8)
    • Microsoft Windows Server (1)
    • Outlook (2)
    • Skype (1)
    • Web Platform Installer (1)
    • WebMatrix (1)
  • Microsoft ADOMD (7)
    • MDX Query (3)
  • Microsoft Office (7)
  • Microsoft Technologies (7)
    • Office Development (5)
  • Microsoft Windows (9)
    • Windows 10 (5)
    • Windows 7 (1)
    • Windows 8.1 (2)
  • Mobile (2)
  • Mobile Brands (1)
    • One Plus (1)
  • MVC (6)
  • News (12)
  • Node JS (5)
  • npm (1)
  • Number Conversions (1)
  • Page (1)
  • PHP (3)
  • Poems (1)
    • Malayalam Poems (1)
  • Products (36)
    • High Map (2)
    • HighChart (8)
      • Drill Down Chart (1)
    • Ignite UI (2)
    • JQWidgets (19)
      • JQX Grid (18)
    • MVC Grid (1)
    • Spire.Doc (1)
    • Spire.PDF (1)
    • Spire.XLS (2)
  • Q&A (7)
  • Raspberry PI (5)
  • React (2)
  • SEO (2)
  • SharePoint (2)
  • Social Media (1)
    • Facebook (1)
  • Software (1)
    • Third Party Software Apps (1)
  • Stories (6)
    • English (2)
    • Malayalam (3)
  • Tips (2)
  • Tools (19)
    • GitHub (1)
    • SSMS (1)
    • Visual Studio (12)
      • Visual Studio 2017 (8)
  • Uncategorized (1)
  • Unit Testing (2)
  • VB.Net (1)
  • Videos (17)
  • Wamp Server (3)
  • Web API (12)
  • Webinars (1)
  • Wordpress (9)

ABOUT ME

I am Sibeesh Venu, an engineer by profession and writer by passion. I’m neither an expert nor a guru. I have been awarded Microsoft MVP 3 times, C# Corner MVP 5 times, DZone MVB. I always love to learn new technologies, and I strongly believe that the one who stops learning is old.  If you would like to know more about me, you can read my story here.

Follow me

CONTACT ME

  • X 384 / A, Katrikkal House, Vembilly Post, Kunnathunadu Panchayat, Ernakulam - 683565, Kerala, India
  • 08893 08893 2
  • info@sibeeshpassion.com

Optin Form

Tags

Achievements ADOMD Angular Angular 5 Angular JS article Article Of The Day Asp.Net Azure Azure IoT C# c-sharp corner Career Advice chart CSharp CSS CSS3 HighChart How To HTML5 HTML5 Chart Interview IoT IoT Hub Javascript JQuery jquery functions JQWidgets JQX Grid Json Microsoft MVC MVP MXChip News Products SQL SQL Server Visual Studio Visual Studio 2017 VS2017 Web API Windows Windows 10 Wordpress
  • Home
  • About
  • Communities
  • Search
© Copyright Sibeesh Passion 2018-2019. All Rights Reserved.