IE has onselectstart this method, by setting this method can prohibit the element text is selected. Firefox does not have this method, but can be resolved through CSS or a workaround:
if (typeof (Element.onselectstart)! = "undefined") {
Forbidden elements are selected under IE
Element.onselectstart = new Function ("return false");
} else {
Workarounds for prohibited elements selected under Firefox
Element.onmousedown = new Function ("return false");
Element.onmouseup = new Function ("return true");
}
------------------------
or use Css:div {
-moz-user-select:none;
-webkit-user-select:none;
User-select:none;
}
------------------------
if (document.all)
{
obj.onselectstart= function () {return false;}; For IE
}
Else
{
obj.onmousedown= function () {return false;};
obj.onmouseup= function () {return true;};
}
Document.onselectstart = new Function (' event.returnvalue=false; ');
JS suppresses the selection of text methods