Simple code that disables the mouse-left key function on a Web page

Source: Internet
Author: User

Web page to prohibit the mouse left and right key function of the simple code this code used to find on the Internet, the trial effect is good, put here to leave a backup, I think this can be regarded as one of the common code. Of course, look at the source of the mouse can certainly use it, but sometimes do not think so complex, demanding so strong, and the source code more than the text.
<script language=javascript> document.oncontextmenu=new Function ("event.returnvalue=false;"); Document.onselectstart=new Function ("event.returnvalue=false;"); </script> Web page prevents the mouse key function of simple code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.