JavaScripture
Contribute via GitHub Feedback

HTMLElement : Element

HTMLElement represents an element in the HTML document tree. HTMLElement is the base type for HTMLDivElement, HTMLSpanElement, HTMLImageElement, and many others.

Instance Properties

accessKey : String

accessKeyLabel : String  

classList : DOMTokenList  

An object that makes it easy to manipulate the class names applied to this element. See also className.

Example:

Run

Results:

 

className : String

A space separated list of CSS class names for this element. Corresponds to the class attribute in HTML. See classList for an easier way to manipulate the classes.

commandChecked : Boolean  

commandDisabled : Boolean  

commandHidden : Boolean  

commandIcon : String  

commandLabel : String  

commandType : String  

contentEditable : String

contextMenu : HTMLMenuElement

dir : String
draggable : Boolean

dropzone : DOMSettableTokenList  

hidden : Boolean

innerHTML : String

Gets or sets the html content inside this element. The element itself is not modified. Compare to outerHTML.

Example:

Run

Results:

 

isContentEditable : Boolean  

lang : String
offsetHeight : Number  

The height of this in CSS pixels. Includes this's border and scrollbar. See also Element.clientHeight and Element.scrollHeight.

Example:

Run

Results:

 

offsetLeft : Number  
offsetParent : Element  
offsetTop : Number  
offsetWidth : Number  

The width of this in CSS pixels. Includes this's border and scrollbar. See also Element.clientWidth and Element.scrollWidth.

Example:

Run

Results:

 

outerHTML : String

Gets or sets the html content inside this element. The element itself is replaced by the provided HTML. Compare to innerHTML.

Example:

Run

Results:

 

spellcheck : Boolean

style : CSSStyleDeclaration  

Contains CSS styles directly set on this. Use window.getComputedStyle(element) to get the effective style including styles from CSS rules.

Example:

Run

Results:

 

tabIndex : Number

title : String

Instance Methods

blur() : undefined

click() : undefined

focus() : undefined

insertAdjacentHTML(position : String, html : String) : undefined

Example:

Run

Results:

 

scrollIntoView([top = false : Boolean]) : undefined

Instance Events

onabort / 'abort'  
listener(event : Event) : undefined

onblur / 'blur'  
listener(event : FocusEvent) : undefined

onchange / 'change'  
listener(event : Event) : undefined

onclick / 'click'  
listener(event : MouseEvent) : undefined

oncompositionend / 'compositionend'  
listener(event : CompositionEvent) : undefined

oncompositionstart / 'compositionstart'  
listener(event : CompositionEvent) : undefined

oncompositionupdate / 'compositionupdate'  
listener(event : CompositionEvent) : undefined

oncontextmenu / 'contextmenu'  
listener(event : Event) : undefined

ondblclick / 'dblclick'  
listener(event : MouseEvent) : undefined

ondrag / 'drag'  
listener(event : Event) : undefined

ondragend / 'dragend'  
listener(event : Event) : undefined

ondragenter / 'dragenter'  
listener(event : Event) : undefined

ondragleave / 'dragleave'  
listener(event : Event) : undefined

ondragover / 'dragover'  
listener(event : Event) : undefined

ondragstart / 'dragstart'  
listener(event : Event) : undefined

ondrop / 'drop'  
listener(event : Event) : undefined

onerror / 'error'  
listener(event : Event, source : String, line : Number, column : Number) : undefined

onfocus / 'focus'  
listener(event : FocusEvent) : undefined

onfocusin / 'focusin'  
listener(event : FocusEvent) : undefined

onfocusout / 'focusout'  
listener(event : FocusEvent) : undefined

oninput / 'input'  
listener(event : InputEvent) : undefined

Example:

Run

Results:

 

oninvalid / 'invalid'  
listener(event : Event) : undefined

onkeydown / 'keydown'  
listener(event : KeyboardEvent) : undefined

onkeypress / 'keypress'  
listener(event : KeyboardEvent) : undefined

onkeyup / 'keyup'  
listener(event : KeyboardEvent) : undefined

onload / 'load'  
listener(event : Event) : undefined

onloadeddata / 'loadeddata'  
listener(event : Event) : undefined

onloadedmetadata / 'loadedmetadata'  
listener(event : Event) : undefined

onloadstart / 'loadstart'  
listener(event : Event) : undefined

onmousedown / 'mousedown'  
listener(event : MouseEvent) : undefined

onmouseenter / 'mouseenter'  
listener(event : MouseEvent) : undefined

Called when the mouse enters the element or any of its descendant nodes. Note, unlike mouseover, mouseenter does not bubble and so it will only fire once as long as the mouse remains within this. See also mouseleave.

Example:

Run

Results:

 

onmouseleave / 'mouseleave'  
listener(event : MouseEvent) : undefined

Called when the mouse leaves the element or any of its descendant nodes. Note, unlike mouseout, mouseleave does not bubble and so it will not fire while mouse remains within this. See also mouseenter.

Example:

Run

Results:

 

onmousemove / 'mousemove'  
listener(event : MouseEvent) : undefined

Called when the mouse moves within the element.

onmouseout / 'mouseout'  
listener(event : MouseEvent) : undefined

Called when the mouse leaves the element by moving out of the bounds of this or by entering the bounds of a child of this. Note, unlike mouseleave, mouseout bubbles and will fire each time the mouse moves to a different child within this. See also mouseover.

Example:

Run

Results:

 

onmouseover / 'mouseover'  
listener(event : MouseEvent) : undefined

Called when the mouse is directly over this. Note, unlike mouseenter, mouseover bubbles and will fire each time the mouse moves to a different child within this. See also mouseout.

Example:

Run

Results:

 

onmouseup / 'mouseup'  
listener(event : MouseEvent) : undefined

onmousewheel / 'mousewheel'  
listener(event : MouseEvent) : undefined

onresize / 'resize'  
listener(event : UIEvent) : undefined

onscroll / 'scroll'  
listener(event : UIEvent) : undefined

onselect / 'select'  
listener(event : Event) : undefined

onunload / 'unload'  
listener(event : Event) : undefined

onwheel / 'wheel'  
listener(event : MouseEvent) : undefined