Exportera (0) Skriv ut
Visa allt
EN
Det här innehållet finns inte tillgängligt på ditt språk men här finns den engelska versionen,

cut | 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;
attachEvent Method object.attachEvent("oncut", handler)
addEventListener Method object.addEventListener("cut", handler, useCapture)

 

Event information

SynchronousNo
BubblesYes
CancelableYes

 

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.

The pEvtObj parameter is required for the following interfaces:

See also

a
address
applet
area
b
bdo
big
blockQuote
body
button
caption
center
cite
code
custom
dd
dfn
dir
div
dl
dt
em
embed
fieldSet
font
form
hn
hr
i
img
input type=button
input type=checkbox
input type=email
input type=file
input type=image
input type=number
input type=password
input type=radio
input type=range
input type=reset
input type=search
input type=submit
input type=tel
input type=text
input type=url
kbd
label
legend
li
listing
map
marquee
menu
nextID
noBR
ol
p
plainText
pre
rt
ruby
s
samp
select
small
span
strike
strong
sub
sup
table
tBody
td
textArea
tFoot
th
tHead
tr
tt
u
ul
var
xmp
Reference
onbeforecopy
onbeforecut
onbeforepaste
oncopy
onpaste
setData
Conceptual
About DHTML Data Transfer

 

 

Visa:
© 2014 Microsoft