HTML oncut Event Attribute

Description

The event attribute oncut allows you to set the script to fire when the user cuts out the contents of an element.

Syntax

<element oncut="script">

Values

  • scriptThe name of the script to use when the event has been triggered.

Example

<!DOCTYPE html> 
  <html> 
    <head>
      <title>oncut event</title> 
    </head> 
    <body> 
    <input type="text" oncut="cutAlarm()" value="Cut this text."> 
    <p id="test"> </p> 
<script> 
function cutAlarm() {
  document.getElementById("test").innerHTML = "The oncut attribute has been triggered!"; 
  } 
</script> 
  </body> 
</html>

Supported Tags

All HTML tags (in most cases, the tag should have the value of the attribute contenteditable="true").

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
??????
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
??????