当元素的内容被剪切时,JavaScript 中会发生哪个事件?
htmljavascriptprogramming scripts更新于 2024/6/8 8:44:17
当元素的内容被剪切时,会发生 oncut 事件。您可以尝试运行以下代码来了解如何在 JavaScript 中使用 oncut 事件 −
示例
<!DOCTYPE html>
<html>
<body>
<input type = "text" oncut = "cutFunction()" value = "cut the text">
<script>
function cutFunction() {
document.write("Text cut!");
}
</script>
</body>
</html>
相关文章
有用资源
html 参考教程 - 该教程包含有关 html 的更多信息:https://www.cainiaomax.com/html/

