document.oncontextmenu = function() { return false; } document.ondragstart = function() { return false; } document.onselectstart = function(event) { try { if (event.srcElement && event.srcElement.tagName == 'INPUT' && event.srcElement.value) { return true; } } catch (e) { return false; } return false; }