.cut()


.cut()Returns: jQuery

Description: Cuts text within an element to clipboard and removes the element.

  • version added: v0.1.1.cut()

    • This method does not accept any arguments.

This function will copy the contents of an element and then remove the element.

Consider the following example:

1
2
3
4
5
6
7
<div>
<p class="cut">Some text to copy</p>
</div>

<script>
$( ".cut" ).cut();
</script>

The text "Some text to copy" will be copied to the clipboard and then the <p> will be removed and returned.

This .cut() process will work as if you used to the following code, in every aspect:

1
$( ".cut" ).copy().remove();