Is there any way to disable copy/paste of specific control on HTML input field ? I found way to disable c/p with preventDefault() , but i need to disable c/p of specific control ?
EDIT:
Or how to restrict specific key to enter on input field? (eg TAB key)
Your Html code
<input type="text" value="" id="myInput" />
Your js code.
window.onload = function() {
var myInput = document.getElementById('myInput');
myInput.onpaste = function(e) {
e.preventDefault();
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.