正如您在片段中看到的,我能够获得输入中PASTED的字符串的值。 我想知道是否有一种简单的方法来获取CUTED字符串的值。
$('#example').on("paste cut", function(e) { var value = ''; if(e.type == 'paste') { value = e.originalEvent.clipboardData.getData('text'); } else if(e.type == 'cut') { // How should I get the removed part of the string } $('#result').html(value); });