onbeforecut, oncut, onbeforepaste, and onpaste Events Sample

Steps to demonstrate the events:

  1. Select the text "Select and Cut this Text" in the light blue div, avoiding extra spaces.
  2. Right-click the selected text, and then choose Cut from the shortcut menu.
  3. Select the text "Paste the Text Here" in the orange div.
  4. Right-click the selected text, and then choose Paste from the shortcut menu.

The onbeforecut event is necessary for enabling the Cut option on the shortcut menu.

Select and Cut this Text

Paste the Text Here



[Right-click and choose View Source from the shortcut menu.]

© 2007 Microsoft Corporation. All rights reserved. Terms of use.