Restricting user not to select Webpage data

Some times we need to restrict user not to select form/Webpage data, it can be done by using below code :

<script type=”text/javascript”>
function disableSelection(target)
if (typeof target.onselectstart!=”undefined”) //IE
target.onselectstart=function(){return false}
else if (typeof!=”undefined”) //Firefox”none”
else //All other (ie: Opera)
target.onmousedown=function(){return false
} = “default”
<h1> Testing code for user not to select form data</h1>
In object-oriented programming (OOP), Inheritance is a way to compartmentalize and reuse code by creating collections of attributes and behaviors called

objects which can be based on previously created objects. In classical inheritance where objects are defined by classes, classes can inherit other classes.

The new classes, known as Sub-classes (or derived classes), inherit attributes and behavior of the pre-existing classes, which are referred to as

Super-classes (or ancestor classes). The inheritance relationship of sub- and superclasses gives rise to a hierarchy. In Prototype-based programming objects

can be defined directly from other objects without the need to define any classes.
<script type=”text/javascript”>
disableSelection(document.body) //disable text selection on entire body of page
//disableSelection(document.body) //Disable text selection on entire body
//disableSelection(document.getElementById(“mydiv”)) //Disable text selection on element with id=”mydiv”