As you may see in the snippet I'm able to get the value of the string that is PASTED in the input. I was wondering if there's a simple way to get the value of the CUTED string.
$('#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);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<input type="text" id="example" value="Some random value" style="width:80%"></div>
<div id="result"></div>