How to disable Paste (Ctrl+V) with jQuery?

Misam picture Misam · Apr 1, 2011 · Viewed 125.7k times · Source

How can I disable Paste (Ctrl+V) option using jQuery in one of my input text fields?

Answer

Misam picture Misam · Apr 1, 2011

This now works for IE FF Chrome properly... I have not tested for other browsers though

$(document).ready(function(){
   $('#txtInput').on("cut copy paste",function(e) {
      e.preventDefault();
   });
});

Edit: As pointed out by webeno, .bind() is deprecated hence it is recommended to use .on() instead.