HTMLElement
Baseline Widely available *
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 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
DOMString
que representa la clave de acceso al elemento.HTMLElement.accessKeyLabel
Read onlyDevuelve un
DOMString
que 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.isContentEditable
Read onlyDevuelve un
Boolean
si el contenido del elemento puede ser editado.Es un
HTMLMenuElement
que representa el menú contextual asociado al elemento. Puede sernull
HTMLElement.dataset
Read onlyDevuelve un
DOMStringMap
que 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
Boolean
que indica si el elemento puede ser arrastrado..HTMLElement.dropzone
Read onlyDevuelve un
DOMSettableTokenList
que refleja el atributo globaldropzone
y describe el comportamiento del elemento con respecto a una operación de soltar.Es un
Boolean
que indica si el elemento está oculto.HTMLElement.itemScope
ExperimentalEs un
Boolean
...HTMLElement.itemType
Read only ExperimentalDevuelve un
DOMSettableTokenList
…HTMLElement.itemId
ExperimentalEs un
DOMString
…HTMLElement.itemRef
Read only ExperimentalDevuelve un
DOMSettableTokenList
…HTMLElement.itemProp
Read only ExperimentalDevuelve un
DOMSettableTokenList
…HTMLElement.itemValue
ExperimentalDevuelve un
Object
…HTMLElement.lang
Es un
DOMString
que representa el lenguaje de los atributos del elemento, texto, y contenido del elemento.HTMLElement.offsetHeight
Read only ExperimentalDevuelve un
double
que contiene la altura de, en relación al diseño (layout)
.HTMLElement.offsetLeft
Read only ExperimentalDevuelve un
double
, que representa la distancia desde el borde izquierdo del elemento hasta el borde izquierdo del elemento padreoffsetParent
'.HTMLElement.offsetParent
Read only ExperimentalReturns an
Element
that is the element from which all offset calculations are currently computed.HTMLElement.offsetTop
Read only ExperimentalReturns a
double
, the distance from this element's top border to itsoffsetParent
's top border.HTMLElement.offsetWidth
Read only ExperimentalReturns a
double
containing the width of an element, relative to the layout.HTMLElement.properties
Read only ExperimentalReturns an
HTMLPropertiesCollection
…HTMLElement.spellcheck
Is a
Boolean
that 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
long
representing the position of the element in the tabbing order.HTMLElement.title
Is a
DOMString
containing the text that appears in a popup box when mouse is over the element.HTMLElement.translate
ExperimentalIs 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.oncopy
No estándarReturns the event handling code for the
copy
event (Error 280959 en Firefox).HTMLElement.oncut
No estándarReturns the event handling code for the
cut
event (Error 280959 en Firefox).HTMLElement.onpaste
No estándarReturns the event handling code for the
paste
event (Error 280959 en Firefox).TouchEventHandlers.ontouchstart
No estándarReturns the event handling code for the
touchstart
event.TouchEventHandlers.ontouchend
No estándarReturns the event handling code for the
touchend
event.TouchEventHandlers.ontouchmove
No estándarReturns the event handling code for the
touchmove
event.TouchEventHandlers.ontouchenter
No estándarReturns the event handling code for the
touchenter
event.TouchEventHandlers.ontouchleave
No estándarReturns the event handling code for the
touchleave
event.TouchEventHandlers.ontouchcancel
No estándarReturns the event handling code for the
touchcancel
event.
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()
ExperimentalMakes the spell checker runs on the element.
Especificaciones
Specification |
---|
HTML # htmlelement |