HTMLElement インターフェイスは HTML 要素を表します. ある要素は直接このインターフェイスを実装し,他の要素はHTMLElementを継承したインターフェイス経由で実装されています.
プロパティ
親である Elementと GlobalEventHandlersからプロパティを継承しています
| 属性 | 型 | 概要 |
|---|---|---|
HTMLElement.accessKey |
DOMString |
要素に割り当てられているアクセスキー |
HTMLElement.accessKeyLabel |
DOMString |
要素に割り当てられているアクセスキーを表す文字列 |
HTMLElement.contentEditable |
DOMString |
Gets/sets whether or not the element is editable. |
HTMLElement.isContentEditable 読取専用 |
Boolean |
Indicates whether or not the content of the element can be edited. |
HTMLElement.dataset 読取専用 |
DOMStringMap |
Allows access to read and write custom data attributes (data-*) of the element. |
HTMLElement.dir |
DOMString |
Gets/sets the directionality of the element. |
HTMLElement.draggable |
Boolean |
|
HTMLElement.dropzone 読取専用 |
DOMSettableTokenList |
|
HTMLElement.hidden |
Boolean |
|
HTMLElement.itemScope |
Boolean |
|
HTMLElement.itemType 読取専用 |
DOMSettableTokenList |
|
HTMLElement.itemId |
DOMString |
|
HTMLElement.itemRef 読取専用 |
DOMSettableTokenList |
|
HTMLElement.itemProp 読取専用 |
DOMSettableTokenList |
|
HTMLElement.itemValue |
any |
|
HTMLElement.lang |
DOMString |
Gets/sets the language of an element's attributes, text, and element contents. |
HTMLElement.offsetHeight 読取専用 |
double |
The height of an element, relative to the layout. |
HTMLElement.offsetLeft読取専用 |
double |
The distance from this element's left border to its offsetParent's left border. |
HTMLElement.offsetParent読取専用 |
Element |
The element from which all offset calculations are currently computed. |
HTMLElement.offsetTop読取専用 |
double |
The distance from this element's top border to its offsetParent's top border. |
HTMLElement.offsetWidth読取専用 |
double |
The width of an element, relative to the layout. |
HTMLElement.properties 読取専用 |
HTMLPropertiesCollection |
|
HTMLElement.spellcheck |
Boolean |
Controls spell-checking (present on all HTML elements) |
HTMLElement.style |
CSSStyleDeclaration |
An object representing the declarations of an element's style attributes. |
HTMLElement.tabIndex |
long |
Gets/sets the position of the element in the tabbing order. |
HTMLElement.title |
DOMString |
A string that appears in a popup box when mouse is over the element. |
HTMLElement.translate |
Boolean |
|
className |
DOMString |
要素に割り当てられている CSS クラス名 |
dataset HTML5 |
DOMStringMap |
要素の data-* 属性としてマップされる |
dir |
DOMString |
要素の dir 属性 |
id |
DOMString |
要素の 個体識別名 |
lang |
DOMString |
要素の lang 属性 |
title |
DOMString |
要素の title 属性 |
Event handlers
The events properties, of the form onXYZ, are defined on the GlobalEventHandlers, implemented by HTMLElement. A few more are specific to HTMLElement.
-
HTMLElement.onTouchStart -
Returns the event handling code for the
touchstartevent. -
HTMLElement.onTouchEnd -
Returns the event handling code for the
touchendevent. -
HTMLElement.onTouchMove -
Returns the event handling code for the
touchmoveevent. -
HTMLElement.onTouchEnter -
Returns the event handling code for the
touchenterevent. -
HTMLElement.onTouchLeave -
Returns the event handling code for the
touchleaveevent. -
HTMLElement.onTouchCancel -
Returns the event handling code for the
touchcancelevent.
メソッド
Inherits methods from its parent, Element.
| メソッド名と引数 | 戻り値 | 概要 |
|---|---|---|
blur() HTML5 |
void |
現在フォーカスされている要素からフォーカスを外します。 |
click() HTML5 |
void |
マウスクリックイベントを要素に送信します。 |
focus() HTML5 |
void |
要素にフォーカスをあてます。 |
HTMLElement.forceSpellCheck() |
void |
仕様
ブラウザ実装状況
| 機能 | Firefox (Gecko) | Chrome | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| 基本サポート | 1.0 (1.7 or earlier) | ? | ? | ? | ? |
accessKey |
5.0 (5.0) | 17.0 | ? | ? | (有)(535.10) |
accessKeyLabel |
8.0 (8.0) | ? | ? | ? | 未サポートWebKit bug 72715 |
blur() |
5.0 (5.0) | ? | ? | ? | ? |
click() |
5.0 (5.0) | ? | ? | ? | (有)(535.24) |
dataset |
6.0 (6.0) | 9.0 | ? | 11.10 | 5.1 |
focus() |
5.0 (5.0) | ? | ? | ? | ? |
| 機能 | Firefox Mobile (Gecko) | Android | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| 基本サポート |
1.0 (1.0) |
? | ? | ? | ? |
accessKey |
5.0 (5.0) | ||||
accessKeyLabel |
8.0 (8.0) | ||||
blur() |
5.0 (5.0) | ||||
click() |
5.0 (5.0) | ||||
dataset |
6.0 (6.0) | ||||
focus() |
5.0 (5.0) |
関連情報
Elementインタフェース