Last updated on April 29th, 2020 at 03:43 am
Reading Time: < 1 minuteI have Three solutions in my mind:
First Is –>
Use ——-> oncopy=”return false” onpaste=”return false”
Name:
<input type="textbox" id="name" oncopy="return false" onpaste="return false" ><br/>
Name:
Second is –> With Jquery ,Use e.preventDefault();
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$('#name').bind("cut copy paste",function(e) {
e.preventDefault();
});
</script>
</head>
Name:
<input type="textbox" id="name" >
Name:
Third is –>With Jquery , Use return false
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$( "#name" ).on( "copy cut paste drop", function() {
return false;
});
</script>
</head>
Name:
<input type="textbox" id="name" >
Name: