Horje

How to Execute a JavaScript when cutting some text in an <input> element

Input Example.
index.html
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>

Output should be:

How to Execute a JavaScript when cutting some text in an <input> element




Type:
html
Category:
Web Tutorial
Sub Category:
HTML Attribute
Uploaded by:
Admin