DOM

Document.defaultView プロパティ

 編集:2022.09.07 by T.A.

Document に関連付けられている Window オブジェクトを返します。もし存在しない場合は null を返します。

構文
Document.defaultView;

Window

Doc=new Document();	//新しい Document オブジェクトを作成
W=Doc.defaultView;	//=[object]:null
W=window.open("", "Test");	//新しいウインドウを開いて、名前(window.name)を「Test」とする。
DW=W.document.defaultView;	//開いたウインドウの Document に関連付けられた Window を得る。
D=DW.name;	//="Test"。(Window.name)

テスト