![]()
documentオブジェクト(documents配列)
現在、表示している文書に情報を持っているオブジェクトで、windowオブジェクトのプロパティでもあります。anchorオブジェクトの定義は、次のHTMLとonLoad、onUnloadのイベントハンドラーが使用されます。
シンタックス
色については名称で指定することもできます。<body background="backgroundimage" bgcolor="#backgroundColor" fgcolor="#foregroundColor" link="#unfollowedLinkColor" alink="#activatedLinkColor" vlink="#visitedLinkColor" [onLoad="handlerText"] [onUnLoad="handlerText"]> </body>
![]()
documentオブジェクトのプロパティやメソッドを使用する場合、次のように指定します。
- document.プロパティ名
 - document.メソッド名(パラメータ)
 
プロパティとなっているオブジェクト
- windowオブジェクト
 
プロパティ
- alinkColor: activatedLinkColorの値
 - linkColor: unfollowedLinkColorの値
 - vlinkColor: visitedLinkColorの値
 - bgColor: backgroundColorの値
 - fgColor: foregroundColorの値
 
- anchors: 文書の中のすべてのアンカーを保持する配列(array)
 - forms: 文書の中のすべてのフォーム
 - links: 文書の中のすべてのリンク
 
- cookie: cookieを指定する
 - lastModified: 文書が更新された最終日時を表わす
 - location: 文書の完全なURLを表わす
 - referrer: この直前の文書のURLを表わす
 - title: <title>タグの内容
 
- clear: ウィンドウの内容を消去する
 - close: ウィンドウの出力ストリームを閉じる
 - open: ウィンドウに新しく出力ストリームを開く
 - write: ウィンドウに式を表示する
 - writeln: ウィンドウの中に改行文字に続いて式を表示する
 <script> document.write(document.bgColor + "<p>"); document.writeln(document.fgColor + "<p>"); document.writeln(document.links[0] + "<p>"); document.writeln(document.links[1]); </script>
![]()
関連項目