How to disable selection on your webpage?

Step::1 Login to your cPanel and click on File Manager

Step::2 Go inside public_html and create a new file i.e “testing.html” You can create a new html file with any name.

Step::3 Right click over the newly created file and choose the Edit option

Step::4 Insert the code given below

<html>
<head>
<style>
body, html{    
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;  
}
</style>
</head>
<body oncontextmenu="return false;">
Here is my code. Select me.
</body>
</html>


Step::5 Click on Save changes button and close the editor.

Test the file in a new tab from your web browser. You will find that your selection feature has been disabled. Infact you will not be able to select any line on your website not even by dragging and dropping.

Visit our Blog for more details. You can also watch the video here.

  • How to disable selection on your webpage, how to disable text selection in your webpage or blog
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Install WordPress in Sub-Directory?

Login to cPanel. Select Softaculous Apps Installer from Software section. Select WordPress...

How to Restore Backups Using JetBackup 4 in cPanel?

Login to cPanel and get inside JetBackups section. Here, you will find multiple features which...

How to Suspend Outgoing Emails of a cPanel Account as WHM Reseller?

To manage the bulk mailing that occurred from a cPanel account hosted within your WHM Reseller,...

How Can You Create/Install WordPress On Sub-Domains?

#1. Create a subdomain of your main domain Log into your cPanel and go to the Subdomains...

How to disallow a particular directory from being crawled by Google?

Login to your cPanel Go inside File Manager Click on public_html Create a robots.txt file....