Javascript Reference
javascript onselectstart Description
lipitor online order <a href="https://lipiws.top/">buy atorvastatin 20mg pill</a> lipitor 80mg canada
Jfrjdj - March 11, 2024, 3:01 a.m.
buy lipitor 80mg online cheap <a href="https://lipiws.top/">atorvastatin 10mg usa</a> lipitor 40mg without prescription
Apxpry - March 10, 2024, 10:55 p.m.
function prevent(e)
{ e=e||window.event
s=e.srcElement||e.target
s.onselectstartSaved=s.onselectStart
s.onselectstart=null
s.attachEvent('onmouseup',restore)
}
function restore(e)
{ e=window.event||e
s=e.srcElement||e.target
s.detachEvent('onmouseup',restore)
s.onselectstart=s.onselectstartSaved }
MyCodeAccount@yahoo.com - June 14, 2011, 11:33 p.m.
My mistake. Upon further investigation in Chrome, textareas are merely immune to this and the contents remain selectable.

Meanwhile, I've found that SPAN elements won't implement it, but DIV elements will, BUT only to turn off selecting the contents of a DIV. If a DIVs parent element (BODY or another DIV) has selection turned off, you can't turn it on just in the DIV. But if selection is on, you can turn it off in specific DIV elements.
Greg - June 12, 2010, 12:58 a.m.
Trying it in Chrome on Windows, putting onselectstart="return true" in your textarea tag enables selecting in the textarea space, but leaves the rest of the body unselectable.
Greg - June 12, 2010, 12:45 a.m.
[NETSECSVC: I am using 'onselectstart="return false"' in my body tag and it works elequently ...]

Declare a variable say:
var enableOnSelectEvent = true;

On your <input>s add onmouseover and onmouseout events:
enableOnSelectEvent = true/false;
<body onselectstart="return !enableOnSelectEvent">

It should work.
javascript manual - Aug. 3, 2009, 8:53 a.m.
I am using 'onselectstart="return false"' in my body tag and it works elequently. However, I have a textbox (for searching) that I want the user to be able to select normally on. Is there a way to re-enable onselectstart for this one element?
NETSECSVC - July 31, 2009, 4:03 p.m.


Email and URL are visible for webmaster only!

Powered by Linode.