== HTMLElement ==
HTML Elements (Topic)
This topic contains all functions that are directly related to HTMLElements:
===== New elements =====
* [[toolbox:element:HTMLElement_new:index|HTMLElement.new()]] – creates a new HTMLElement [static method].
* [[toolbox:element:appendNew:index|.appendNew()]] – creates a new HTMLElement and attaches it as a child element (at the end)
* [[toolbox:element:prependNew:index|.prependNew()]] – creates a new HTMLElement and attaches it as a child element (at the beginning)
===== HTML functions =====
* [[toolbox:element:setHtml:index|.setHtml()]] – parses XHTML string and inserts the result as child nodes.
* [[toolbox:element:getHtml:index|.getHtml()]] – returns the ''innerHTML'' of an Element as String.
===== Text content =====
* [[toolbox:element:gettext:index|.getText()]] – returns the entire text content of the Element (including from child nodes).
* [[toolbox:element:settext:index|.setText()]] – sets the entire text value of the Element (overriding existing child nodes).
* [[toolbox:element:appendtext:index|.appendText()]] – appends a new text node as the last child of the Element.
* [[toolbox:element:prependtext:index|.prependText()]] – prepends a new text node as the first child of the Element.
===== Attributes =====
* [[toolbox:element:getattr:index|.getAttr()]] – returns the current value of an attribute of the Element.
* [[toolbox:element:setattr:index|.setAttr()]] – sets the value of an attribute of the Element.
* [[toolbox:element:hasattr:index|.hasAttr()]] – returns true, if the Element has an attribute assigned.
===== Utility methods =====
* [[toolbox:element:empty:index|.empty()]] – removes all of the element’s child nodes.
* [[toolbox:element:load:index|.load()]] – Loads an HTML snippet into an element.
===== More information =====
* [[mdn>Web/JavaScript/Reference/HTMLElement|HTMLElement]] on MDN.