![]() |
Definition and Usage
The
Note:
Although the Tip: There are three ways to cut the content of an element:
Applies to
The
Browser Support
|
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<input type="text" oncut="myFunction()" value="Try to cut this text">
<p id="demo"></p>
<script>
function myFunction() { document.getElementById("demo").innerHTML = "You cut text!";
}
</script>
</body>
</html>
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<p contenteditable="true" oncut="myFunction()">Try to cut this text</p>
<script>
function myFunction() { alert("You cut text!");
}
</script>
</body>
</html>
html oncut attribute |
How to Execute a JavaScript when cutting some text in an <input> element | HTML Attribute |
How to Execute a JavaScript when cutting some text of a <p> element (Note that contenteditable is set to "true") | HTML Attribute |
Type
: |
Develop |
Category
: |
Web Tutorial |
Sub Category
: |
HTML Attribute |
Uploaded by
: |
Admin |
Read Article https://horje.com/learn/1434/reference