<p>I've noticed that some sites (usually banks) suppress the ability to paste text into text fields. How is this done? I know that JavaScript can be used to swallow the keyboard shortcut for paste, but what about the right-click menu item?</p>

Probably using the
```
onpaste
```
event, and either
```
return false
```
from it or use
```
e.preventDefault()
```
on the Event object.
Note that
```
onpaste
```
is
non standard
, don't rely on it for production sites, because it will not be there forever.
```
```
$(document).on("paste",function(e){
  console.log("paste")
  e.preventDefault()
  return false;
})
```
```