Get html from clipboard in javascript

前端 未结 3 857
一整个雨季
一整个雨季 2020-12-15 05:25

I need to implement task which is quite common feature for RichTextEditors - take HTML from clipboard. Can anyone help with guide on how to solve this task?

3条回答
  •  Happy的楠姐
    2020-12-15 06:04

    In Chrome, I access clipboardData through the event using this code:

    $(document).bind('paste', function(e) {
        var clipboardData = e.originalEvent.clipboardData;
    });
    

提交回复
热议问题