DOM

UIEvent.view プロパティ

 編集:2022.10.05 by T.A.

[Edge]。読取専用。→

UIEvent イベントを生成したものの WindowProxy オブジェクトを返します。ブラウザーでは、これはイベントが発行された Window です。

構文
UIEvent.view

AbstractView オブジェクトの参照です¶。

HTML:

<SPAN id=IdTest1>[ここでクリックしてみて…]</SPAN><BR>
<SPAN id=IdLog></SPAN>

JavaScript:

function Job1(eve){ //clickイベントの処理:
  D=eve.view; //=[object]:[object Window]
詳細 //window=[object]:[object Window] //self=[object]:[object Window] //document=[object]:[object HTMLDocument] //name=[string]:Content //location=[object]:file:///C:/Users/asmin/Documents/HTML%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B・・・ //customElements=[object]:[object CustomElementRegistry] //history=[object]:[object History] //locationbar=[object]:[object BarProp] //menubar=[object]:[object BarProp] //personalbar=[object]:[object BarProp] //scrollbars=[object]:[object BarProp] //statusbar=[object]:[object BarProp] //toolbar=[object]:[object BarProp] //status=[string]: //closed=[boolean]:false //frames=[object]:[object Window] //length=[number]:0 //top=[object]:エラー:undefined //opener=[object]:null //parent=[object]:エラー:undefined //frameElement=[object]:null //navigator=[object]:[object Navigator] //origin=[string]:null //external=[object]:[object External] //screen=[object]:[object Screen] //innerWidth=[number]:1155 //innerHeight=[number]:649 //scrollX=[number]:0 //pageXOffset=[number]:0 //scrollY=[number]:949 //pageYOffset=[number]:949 //visualViewport=[object]:[object VisualViewport] //screenX=[number]:0 //screenY=[number]:0 //outerWidth=[number]:1366 //outerHeight=[number]:728 //devicePixelRatio=[number]:1 //clientInformation=[object]:[object Navigator] //screenLeft=[number]:0 //screenTop=[number]:0 //…
IdLog.innerHTML=IdLog.innerHTML +"●"; //表示。 } IdTest1.onclick=Job1; //イベント割り当て。

テスト