How to Disable the Mouse Pointer Using JavaScript

104 16
    • 1). Press the "Windows" plus "R" keys on the keyboard to display the "Run" dialog box. Type "Notepad" in the text box and press "Enter" to open the program.

    • 2). Click the "File" drop-down menu and select "Open." Navigate to the location of the HTML file to edit and click the "Open" button to load the file.

    • 3). Scroll down to the "<head>" section of the code.

    • 4). Type "<script language="text/javascript">" and press "Enter." Add the following function:

      function noLeftClick() {

      Press Enter. Type:

      if (event.button==1) {

      Press "Enter."

    • 5). Type:

      alert('Left Click Disabled')

      Press "Enter."

      Type two close brackets as follows:

      }

      }

      Press "Enter."

      Type:

      document.onmousedown=noLeftClick"

      Press "Enter."

    • 6). Type "</script>" to complete the code. Click the "File" drop-down and select "Save." Upload the file to your server and test the page.

Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.