HTMLHtmlElement インターフェイス
HTMLHtmlElement インターフェイスは、HTMLドキュメントにおいてルートエレメントになる <html> エレメントオブジェクトを定義したインターフェイスです。
HTMLElement インターフェイスを継承しています。
- EventTarget
- └─ Node
- └─ Element
- └─ HTMLElement
- ├─ HTMLHtmlElement
- ┆
- └─ HTMLElement
- └─ Element
- └─ Node
正規のドキュメントなら、 document.documentElement プロパティによって取得されるのは HTMLHtmlElement オブジェクトになります。
オブジェクトツリーでは Document 以下に <html> 、その下に <head> や <body> があります。
コンストラクター
HTMLHtmlElement オブジェクトを生成するには、Document.createElement() メソッドを使用します。
var html_ = document.createElement('html');
既に <html> エレメントがある場合はエラーになります。<html> エレメントは document にひとつです。
HTMLHtmlElement の取得
HTMLHtmlElement オブジェクトを取得するには、Document.getElementsByTagName() メソッドなどを使用します。
var html_ = document.getElementsByTagName('html')[0] ;
プロパティ(Properties)
独自のプロパティはありません。HTMLElement インターフェイスから継承されたプロパティが使用できます。HTMLElement インターフェイスは Node 、Element インターフェイスを継承しています。
Nodeのプロパティ一覧
タイプ名(ハンドラー名) | 概要 | 分類 |
---|
Elementのプロパティ一覧
タイプ名(ハンドラー名) | 概要 | 分類 |
---|
HTMLElementのプロパティ一覧
タイプ名(ハンドラー名) | 概要 | 分類 |
---|
メソッド(Methods)
独自のメソッドはありません。HTMLElement インターフェイスから継承されたメソッドが使用できます。HTMLElement インターフェイスは Node 、Element インターフェイスを継承しています。
以下は HTMLElement、Node、Element のメソッドです。
Nodeのメソッド一覧
タイプ名(ハンドラー名) | 概要 | 分類 |
---|
Elementのメソッド一覧
タイプ名(ハンドラー名) | 概要 | 分類 |
---|
HTMLElementのメソッド一覧
タイプ名(ハンドラー名) | 概要 | 分類 |
---|
イベント(Event)
HTMLHtmlElement にイベントハンドラーを定義する方法には以下があります。
HTMLHtmlElement.addEventListener( 'click', ()=>{...} )
HTMLHtmlElement.onclick = function(){...}
<html onclick = "..." >
イベントについてはEventを参照してください。 イベントの監視についてはEventTargetが担っています。
以下は HTMLElement インターフェイスに定義されたイベント一覧です。HTMLElement インターフェイスのイベントには、GlobalEventHandlers、DocumentAndElementEventHandlers を含みます。
以下には、<html> である HTMLHtmlElement で利用できないイベントハンドラーも含んでいます。
GlobalEventHandlersのイベント一覧
タイプ名(ハンドラー名) | 概要 | 分類 |
---|
DocumentAndElementEventHandlersのイベント一覧
タイプ名(ハンドラー名) | 概要 | 分類 |
---|
HTMLElementのイベント一覧
タイプ名(ハンドラー名) | 概要 | 分類 |
---|
関連(Related)
HTML、CSS、DOMのHTMLエレメント、Windowに関する用途一覧です。
HTML
CSS
- サイズ
-
- height、 width、 max-height、 max-width、 min-height、 min-width、 resize
- スクロール追加
- overflow、 overflow-x、 overflow-y
- マージン、パディング、ボーダー
-
- 共通
- box-sizing、 display
- マージン
- margin、 margin-bottom、 margin-left、 margin-right、 margin-top
- パディング
- padding、 padding-bottom、 padding-left、 padding-right、 padding-top
- ボーダー、罫線
-
- 全体
- border、 border-collapse、 border-color、 border-spacing、 border-style、 border-width
- 上辺
- border-top、 border-top-color、 border-top-left-radius、 border-top-right-radius、 border-top-style、 border-top-width
- 下辺
- border-bottom、 border-bottom-color、 border-bottom-left-radius、 border-bottom-right-radius、 border-bottom-style、 border-bottom-width
- 左辺
- border-left、 border-left-color、 border-left-style、 border-left-width
- 右辺
- border-right、 border-right-color、 border-right-style、 border-right-width
- 角を丸に
- border-radius
- 画像を線に
- border-image、 border-image-outset、 border-image-repeat、 border-image-slice、 border-image-source、 border-image-width
- アウトライン
- outline、 outline-color、 outline-offset、 outline-style、 outline-width
- 配置
-
- 位置調整
- bottom、 left、 right、 top、 position、 z-index
- 横並び(フレックス)
- display:flex;、 align-content、 align-items、 align-self、 justify-content、 flex-wrap、 flex-basis、 flex-direction、 flex-flow
- 配列(グリッド)
- display:grid;、 grid-area、 grid-auto-columns、 grid-auto-flow、 grid-auto-rows、 grid-column、 grid-column-end、 grid-column-gap、 grid-column-start、 grid-gap、 grid-row、 grid-row-end、 grid-row-gap、 grid-row-start、 grid-template、 grid-template-areas、 grid-template-columns、 grid-template-rows、
- フレックス、グリッドの共通 横並び順
- order
- 背景
- background、 background-attachment、 background-blend-mode、 background-clip、 background-color、 background-image、 background-origin、 background-position、 background-repeat、 background-size、 linear-gradient、 radial-gradient
- フィルタ、加工
-
- filter、 transform、 transform-origin
- ブレンド
- isolation、 linear-gradient()、 mix-blend-mode、 radial-gradient()
- 影
- box-shadow
- 透過
- opacity
- 回転
- backface-visibility、
- 立体
- perspective、 perspective-origin
- 切り取り
- clip-path
- カラム
- column-fill、 column-gap、 column-rule、 column-rule-color、 column-rule-style、 column-rule-width、 column-span、 column-width、 columns
- ページ内移動
- scroll-behavior
- 表示、非表示
- visibility
DOM
HTMLエレメント
- インターフェース、クラス
- Document、 Element、 FocusEvent、 Attr
- イベント
- blur、 focus、 focusin、 focusout、 load、 resize、 scroll、 toggle
- プロパティ
- メソッド
Window
- インターフェース
- HashChangeEvent、 PageTransitionEvent、 Window
- イベント
- beforeunload、 hashchange、 load、 pagehide、 pageshow、 unload
- プロパティ
- newURL、 oldURL、 persisted
- メソッド
- clearTimeout()、 setTimeout()