This page was translated from English by the community. Learn more and join the MDN Web Docs community.
HTMLElement
Baseline
Widely available
*
This feature is well established and works across many devices and browser versions. It’s been available across browsers since июль 2015 г..
* Some parts of this feature may have varying levels of support.
Интерфейс HTMLElement представляет собой любой элемент HTML. Некоторые элементы напрямую используют этот интерфейс, другие - через промежуточный интерфейс.
Свойства
Наследует свойства родителя, Element, и реализует их через GlobalEventHandlers и TouchEventHandlers.
HTMLElement.accessKey— ключ доступа-
Эта строковая переменная
DOMStringотображает ключ доступа, сопоставленный элементуElement. HTMLElement.accessKeyLabelТолько для чтения-
Возвращает
DOMString, содержащий назначенный ключ доступа элемента. HTMLElement.contentEditable-
Является
DOMString, где значение" true "означает, что элемент доступен для редактирования, а значение" false " означает, что это не так. HTMLElement.isContentEditableТолько для чтения-
Возвращает
Boolean, который указывает, можно ли редактировать содержимое элемента. -
Является
HTMLMenuElement, представляющим контекстное меню, связанное с элементом. Может быть null HTMLElement.datasetТолько для чтения — набор данных-
Возвращает
domstringmap, который позволяет получить доступ к чтению и записи атрибутов пользовательских данных элемента (data-*) . HTMLElement.dir-
Is a
DOMString, reflecting thedirglobal attribute, representing the directionality of the element. Possible values are"ltr","rtl", and"auto". HTMLElement.draggable-
Is a
Booleanindicating if the element can be dragged. HTMLElement.dropzoneТолько для чтения-
Returns a
DOMSettableTokenListreflecting thedropzoneglobal attribute and describing the behavior of the element regarding a drop operation. -
Is a
Booleanindicating if the element is hidden or not. HTMLElement.itemScopeЭкспериментальная возможность-
Is a
Boolean... HTMLElement.itemTypeТолько для чтения Экспериментальная возможность-
Returns a
DOMSettableTokenList... HTMLElement.itemIdЭкспериментальная возможность-
Is a
DOMString... HTMLElement.itemRefТолько для чтения Экспериментальная возможность-
Returns a
DOMSettableTokenList... HTMLElement.itemPropТолько для чтения Экспериментальная возможность-
Returns a
DOMSettableTokenList... HTMLElement.itemValueЭкспериментальная возможность-
Returns an
Object... HTMLElement.lang-
Is a
DOMStringrepresenting the language of an element's attributes, text, and element contents. HTMLElement.offsetHeightТолько для чтения Экспериментальная возможность-
Returns a
doublecontaining the height of an element, relative to the layout. HTMLElement.offsetLeftТолько для чтения Экспериментальная возможность-
Returns a
double, the distance from this element's left border to itsoffsetParent's left border. HTMLElement.offsetParentТолько для чтения Экспериментальная возможность-
Returns an
Elementthat is the element from which all offset calculations are currently computed. HTMLElement.offsetTopТолько для чтения Экспериментальная возможность-
Returns a
double, the distance from this element's top border to itsoffsetParent's top border. HTMLElement.offsetWidthТолько для чтения Экспериментальная возможность-
Returns a
doublecontaining the width of an element, relative to the layout. HTMLElement.propertiesТолько для чтения Экспериментальная возможность-
Returns an
HTMLPropertiesCollection... HTMLElement.spellcheck-
Is a
Booleanthat controls spell-checking. It is present on all HTML elements, though it hasn't an effect on all of them. HTMLElement.style-
Is
CSSStyleDeclaration, an object representing the declarations of an element's style attributes. HTMLElement.tabIndex-
Is a
longrepresenting the position of the element in the tabbing order. HTMLElement.title-
Is a
DOMStringcontaining the text that appears in a popup box when mouse is over the element. HTMLElement.translateЭкспериментальная возможность-
Is a
Boolean
Event handlers
Most events properties, of the form onXYZ, are defined on the GlobalEventHandlers or TouchEventHandlers, implemented by HTMLElement. A few more are specific to HTMLElement.
HTMLElement.oncopyНе стандартно-
Returns the event handling code for the
copyevent (Firefox bug 280959). HTMLElement.oncutНе стандартно-
Returns the event handling code for the
cutevent (Firefox bug 280959). HTMLElement.onpasteНе стандартно-
Returns the event handling code for the
pasteevent (Firefox bug 280959). TouchEventHandlers.ontouchstartНе стандартно-
Returns the event handling code for the
touchstartevent. TouchEventHandlers.ontouchendНе стандартно-
Returns the event handling code for the
touchendevent. TouchEventHandlers.ontouchmoveНе стандартно-
Returns the event handling code for the
touchmoveevent. TouchEventHandlers.ontouchenterНе стандартно-
Returns the event handling code for the
touchenterevent. TouchEventHandlers.ontouchleaveНе стандартно-
Returns the event handling code for the
touchleaveevent. TouchEventHandlers.ontouchcancelНе стандартно-
Returns the event handling code for the
touchcancelevent.
Methods
Inherits methods from its parent, Element.
HTMLElement.blur()-
Removes keyboard focus from the currently focused element.
HTMLElement.click()-
Sends a mouse click event to the element.
HTMLElement.focus()-
Makes the element the current keyboard focus.
HTMLElement.forceSpellCheck()Экспериментальная возможность-
Makes the spell checker runs on the element.
Спецификации
| Specification |
|---|
| HTML> # htmlelement> |
Совместимость с браузерами
Loading...