The HTMLElement Members

HTMLElement object represents the HTML elements in the document.

NameDescriptionReturns
add(<class>) Adds the class to the element.void
appendChild(HTMLElement)Appends the specified element as a child of the current element.HTMLElement
attributesReturns the attributes applied to the element.Attr[]
checkedGets or sets the presence of the checked attribute.boolean
classListGets or sets the list of classes.DOMTokenList
classNameGets or sets the list of classes.string
cloneNode(boolean)Copies an element.HTMLElement
compareDocumentPosition(HTMLElement)Determines the relative position of an element.number
contains(<class>) Returns true if the element belongs to the specified class.boolean
createElement(<tag>) Creates a new HTMLElement object with the specified tag type.HTMLElement
createTextNode(<text>) Creates a new Text object with the specified content.Text
datasetReturns the data-* attributes. string[<name>]
dirGets or sets the dir attribute.string
disabledGets or sets the disabled attribute.boolean
getAttribute(<name>) Returns the value of the specified attribute.string
hasAttribute(<name>) Returns true if the element has the specified attribute.boolean
hiddenGets or sets the hidden attribute.boolean
idGets or sets the id.string
innerHTMLGets or sets the element's content.string
insertAdjacentHTML(<pos>, <text>) Inserts HTML relative to the element.void
insertBefore(<newelem>, <childElem>) Inserts the first element before the second (child) element.HTMLElement
isEqualNode(<HTMLElement>) Determines whether the specified element is equal to the current element.boolean
isSameNode(HTMLElement)Determines whether the specified element is the same as the current element.boolean
langGets or sets the lang attribute.string
lengthReturns the number of classes to which the element belongs.number
outerHTMLGets or sets an element's HTML and contents.string
remove(<class>) Removes the class.boid
removeAttribute(<name>) Removes the specified attribute from the element.void
removeChild(HTMLElement)Removes the specified child of the current element.HTMLElement
replaceChild(HTMLElement, HTMLElement)Replaces a child of the current element.HTMLElement
setAttribute(<name>, <value>) Applies an attribute with the specified name and value.void
spellcheckGets or sets the spellcheck attribute.boolean
stylethe style of the elementCSSStyleDeclaration
tabIndexGets or sets the value of the tabindex attribute.number
tagNameReturns the tag name indicating the element type.string
titleGets or sets the title attribute.string
toggle(<class>) Adds the class if it is not present, and removes it if it is present.boolean
Home 
  JavaScript Book 
    DOM  

HTMLElement:
  1. The HTMLElement Members
  2. element tag name, id, direction, language, hidden disabled information
  3. addEventListener
  4. appendChild
  5. attributes returns a collection containing all of the attributes
  6. classList
  7. className
  8. cloneNode
  9. createElement
  10. createTextNode
  11. dataset
  12. getAttribute
  13. getElementsByTagName
  14. hasAttribute
  15. innerHTML
  16. insertAdjacentHTML
  17. insertBefore
  18. isSameNode
  19. outerHTML
  20. onmouseout
  21. onmouseover
  22. querySelectorAll
  23. removeEventListener