event.keyCode

書式

event.propertyName
イベントオブジェクト.propertyName

説明

内容が変化したプロパティの名前を示します。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.body.onpropertychange = function(evt) {
try {
document.getElementById("result").innerHTML = "evt.propertyName = "+evt.propertyName;
}catch(e){
document.getElementById("result").innerHTML = "event.propertyName = "+event.propertyName;
}
}
}
// --></script>
</head>
<body>
<form>
<input type="button" onclick="document.body.bgColor='yellow'" value="yellow">
<input type="button" onclick="document.body.bgColor='orange'" value="orange">
</form>
<div id="result"></div>
</body>
</html>