HTMLElement
Baseline
Widely available
*
This feature is well established and works across many devices and browser versions. It’s been available across browsers since julio de 2015.
* Some parts of this feature may have varying levels of support.
La interfaz HTMLElement representa cualquier elemento HTML. Algunos elementos implementan directamente esta interfaz, otros la implementan a través de una interfaz que hereda de ella.
Properties
Hereda propiedades de su padre, Element, y los implementalo de GlobalEventHandlers y TouchEventHandlers.
HTMLElement.accessKey-
Es un
DOMStringque representa la clave de acceso al elemento. HTMLElement.accessKeyLabelRead only-
Devuelve un
DOMStringque contiene la clave asignada del elemento. HTMLElement.contentEditable-
Es un
DOMString, donde el valor"true"significa que el elemento es editable y si el valor es"false"significa que no lo es. HTMLElement.isContentEditableRead only-
Devuelve un
Booleansi el contenido del elemento puede ser editado. -
Es un
HTMLMenuElementque representa el menú contextual asociado al elemento. Puede sernull HTMLElement.datasetRead only-
Devuelve un
DOMStringMapque permite el acceso de lectura y escritura de los atributos personalizados del elemento (data-*) . HTMLElement.dir-
Es un
DOMString, que refleja el atributo globaldir, representando la direccionalidad del elemento. Los posibles valores son"ltr","rtl", and"auto". HTMLElement.draggable-
Es un
Booleanque indica si el elemento puede ser arrastrado.. HTMLElement.dropzoneRead only-
Devuelve un
DOMSettableTokenListque refleja el atributo globaldropzoney describe el comportamiento del elemento con respecto a una operación de soltar. -
Es un
Booleanque indica si el elemento está oculto. HTMLElement.itemScopeExperimental-
Es un
Boolean... HTMLElement.itemTypeRead only Experimental-
Devuelve un
DOMSettableTokenList… HTMLElement.itemIdExperimental-
Es un
DOMString… HTMLElement.itemRefRead only Experimental-
Devuelve un
DOMSettableTokenList… HTMLElement.itemPropRead only Experimental-
Devuelve un
DOMSettableTokenList… HTMLElement.itemValueExperimental-
Devuelve un
Object… HTMLElement.lang-
Es un
DOMStringque representa el lenguaje de los atributos del elemento, texto, y contenido del elemento. HTMLElement.offsetHeightRead only Experimental-
Devuelve un
doubleque contiene la altura de, en relación al diseño (layout). HTMLElement.offsetLeftRead only Experimental-
Devuelve un
double, que representa la distancia desde el borde izquierdo del elemento hasta el borde izquierdo del elemento padreoffsetParent'. HTMLElement.offsetParentRead only Experimental-
Returns an
Elementthat is the element from which all offset calculations are currently computed. HTMLElement.offsetTopRead only Experimental-
Returns a
double, the distance from this element's top border to itsoffsetParent's top border. HTMLElement.offsetWidthRead only Experimental-
Returns a
doublecontaining the width of an element, relative to the layout. HTMLElement.propertiesRead only Experimental-
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.translateExperimental-
Is a
Boolean
Event handlers
La mayoria de las propiedades de los eventos, del formulario onXYZ, estan definidas en las interfaces GlobalEventHandlers or TouchEventHandlers, implementadas por HTMLElement. Otras pocas son especificas de HTMLElement.
HTMLElement.oncopyNo estándar-
Returns the event handling code for the
copyevent (Error 280959 en Firefox). HTMLElement.oncutNo estándar-
Returns the event handling code for the
cutevent (Error 280959 en Firefox). HTMLElement.onpasteNo estándar-
Returns the event handling code for the
pasteevent (Error 280959 en Firefox). TouchEventHandlers.ontouchstartNo estándar-
Returns the event handling code for the
touchstartevent. TouchEventHandlers.ontouchendNo estándar-
Returns the event handling code for the
touchendevent. TouchEventHandlers.ontouchmoveNo estándar-
Returns the event handling code for the
touchmoveevent. TouchEventHandlers.ontouchenterNo estándar-
Returns the event handling code for the
touchenterevent. TouchEventHandlers.ontouchleaveNo estándar-
Returns the event handling code for the
touchleaveevent. TouchEventHandlers.ontouchcancelNo estándar-
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()Experimental-
Makes the spell checker runs on the element.
Especificaciones
| Specification |
|---|
| HTML> # htmlelement> |
Compatibilidad con navegadores
Loading…