onBeforeCut

書式

<タグ名 onBeforeCut="イベント発生時の処理">
オブジェクト.onbeforecut = "イベント発生時の処理"

説明

カット前に時に発生するイベントです。onCutイベントも同時に設定されている場合には先にonBeforeCutイベントが発生した後にonCutイベントが発生します。Windows版Internet Explorer 5以降で利用できます。

サンプルコード [実行]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<script type="text/javascript"><!--
window.onload = function() {
document.getElementById("tField").onbeforecut = function(){
document.getElementById("result").innerHTML = "Before Cut";
}
}
// --></script>
</head>
<body>
<form>
<input type="text" id="tField" value="Sample">
</form>
<div id="result"></div>
</body>
</html>