Some times we need to restrict user not to select form/Webpage data, it can be done by using below code :
if (typeof target.onselectstart!=”undefined”) //IE
else if (typeof target.style.MozUserSelect!=”undefined”) //Firefox
else //All other (ie: Opera)
target.style.cursor = “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.
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”