I am using below script to stop copy, paste, f12, ctr+u etc and disable mouse right click.
<script> var message="Copyright 2017-2018";
document.onkeydown = function(e) {
if(e.ctrlKey && e.shiftKey && e.which==73)
return false;
if (e.which == 123)
return false;
if (e.ctrlKey && ((e.which == 85) || (e.which == 65) || (e.which == 88) || (e.which == 67) || (e.which == 2) || (e.which == 3) || (e.which == 123) || (e.which == 83))) {
alert(message);
return false;
}
}
// right click code
var isNS = (navigator.appName == "Netscape") ? 1 : 0;
if (navigator.appName == "Netscape")
document.captureEvents(Event.MOUSEDOWN || Event.MOUSEUP);
function mischandler() {
return false;
}
function mousehandler(e) {
var myevent = (isNS) ? e : event;
var eventbutton = (isNS) ? myevent.which : myevent.button;
if ((eventbutton == 2) || (eventbutton == 3)) return false;
}
document.oncontextmenu = mischandler;
document.onmousedown = mousehandler;
document.onmouseup = mousehandler;
//select content code disable alok goyal
function killCopy(e) {
return false
}
function reEnable() {
return true
}
document.onselectstart = new Function("return false")
if (window.sidebar) {
document.onmousedown = killCopy
document.onclick = reEnable
}
</script>
I want to enable only copy and paste feature on my search bar. Below is my search bar code.
<div class="search-input">
<input aria-label="Search this blog" autocomplete="off" name="q" placeholder="हिंदी में ही लिखें" value="">
</div>
Is there is any way to only enable copy and paste feature on the search bar.