oncut event

Fires on the source element when the object or selection is removed from the document and added to the system clipboard.

Syntax

HTML Attribute <element oncut = "handler(event)">
Event Property object.oncut = handler;

Event information

SynchronousNo
BubblesNo
CancelableNo

Event handler parameters

pEvtObj [in]

Type: IHTMLEventObj

Standards information

There are no standards that apply here.

Remarks

Creating custom code for cutting requires several steps:

  1. Set event.returnValue=false in the onbeforecut event to enable the Cut shortcut menu item.
  2. Specify a data format in which to transfer the selection through the setData method of the clipboardData object.
  3. Invoke the setData method in the oncut event.

Set event.returnValue=false in the oncut event handler to cancel the default action. The default action must be canceled to successfully use the setData method. Web authors can use the innerHTML property or the createRange method to perform the cut operation once the event is canceled.

Removes the selection from the document and persists it in the clipboard.

To invoke this event, do one of the following:

  • Right-click to display the shortcut menu and select Cut.
  • Or press CTRL+X if the selection is within a text field.

See also

a
address
area
b
bdo
blockQuote
body
button
caption
cite
code
custom
dd
div
dl
dt
em
embed
fieldSet
form
hn
hr
i
img
input type=button
input type=checkbox
input type=file
input type=image
input type=password
input type=radio
input type=reset
input type=submit
input type=text
kbd
label
legend
li
map
ol
p
pre
rt
ruby
s
samp
select
small
span
strong
sub
sup
table
tBody
td
textArea
tFoot
th
tHead
tr
u
ul
var
Reference
onbeforecopy
onbeforecut
onbeforepaste
oncopy
onpaste
setData
Conceptual
About DHTML Data Transfer

 

 

Send comments about this topic to Microsoft

Build date: 11/14/2012

Show:
© 2014 Microsoft