Prevent or Disable Copy or Paste In Input Fields

Using jQuery we can disable or prevent copy or pasting of input fields, jQuery has built-in access to this functionality in browsers by exposing them as events, that is by binding any input element like text input, text area, etc, with these events and calling the preventDefault() event which prevents the user from copy or pasting text into these fields. We observe these in many forms, especially ones those of more secure websites(like online banking). Check out the below snippets of its implementation.

Disable Copying

Select Code
$('input').bind('copy', function(e) {
 e.preventDefault();
});

Disable Copying and Pasting

Select Code
$('input').bind('copy paste', function(e) {
 e.preventDefault();
});