event.keyCode

内容が変化したプロパティの名前を示します。Windows版Internet Explorer 5以降で動作します。

構文

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

例文

<html>
 <head>
  <title>event.keyCode</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>

関連記事

スポンサーリンク

EXPLAIN 問い合わせ文の実行計画を表示する

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る