元素内容被剪切时,JavaScript中哪个事件发生?
该 oncut 当一个元素的内容被切断发生的事件。您可以尝试运行以下代码以了解如何使用JavaScript中的oncut事件-
示例
<!DOCTYPE html>
<html>
<body>
<input type = "text" oncut = "cutFunction()" value = "cut the text">
<script>
function cutFunction() {
document.write("文字剪下!");
}
</script>
</body>
</html>