Using chrome clipboardData and file reader objects, You can implement some functions well.
Function Test (EVT) {// For chrome var clipboardData = EVT. clipboardData; For (VAR I = 0; I <clipboardData. items. length; I ++) {var item = clipboardData. items [I]; If (item. kind = 'file' & item. type. match (/^ image \ // I) {// blob is the binary image data in the clipboard var blob = item. getasfile (), reader = new filereader (); // defines the callback reader after filereader reads data. onload = function () {var shtml = ''; // The result should be a base64 encoded image document. getelementbyid ('dd '). innerhtml + = shtml;} reader. readasdataurl (BLOB); // read the binary image with filereader. After reading the binary image, the callback function defined above will be called }}}
<Textarea id = "T" onpaste = "test (event)" Cols = 60 rows = 5> </textarea> <Div id = "DD"> </Div