Skip to content

SVGElement

Unofficial

Augments the built-in SVGElement interface.

Signature:

export interface SVGElement extends Element

Extends: Element

Properties

Property Type Description
constructorWin Window Global window object.
(Inherited from Element)
doc Document The document this node belongs to, or the global document.
(Inherited from Element)
win Window The window object this node belongs to, or the global window.
(Inherited from Element)

Methods

Method Returns Description
addClass(classes?) void Adds a class to the element.
(Inherited from Element)
addClasses(classes) void Adds multiple classes to the element.
(Inherited from Element)
appendText(val) void Appends a text node to the node.
(Inherited from Element)
createDiv(o?, callback?) HTMLDivElement Creates a new <div> element.
(Inherited from Element)
createEl(tag, o?, callback?) HTMLElementTagNameMap[K] Create an element and append it to this node.
(Inherited from Element)
createSpan(o?, callback?) HTMLSpanElement Creates a new <span> element.
(Inherited from Element)
createSvg(tag, o?, callback?) SVGElementTagNameMap[K] Creates a new svg element such as <svg>, <circle>, <rect>, etc.
(Inherited from Element)
detach() void Detaches the node from the DOM.
(Inherited from Element)
empty() void Empties the node.
(Inherited from Element)
find(selector) Element | null Finds the first descendant element that matches the selector.
(Inherited from Element)
findAll(selector) Element[] Finds all descendant elements that match the selector.
(Inherited from Element)
findAllSelf(selector) Element[] Finds all descendant elements or self that match the selector.
(Inherited from Element)
getAttr(qualifiedName) null | string Gets an attribute from the element.
(Inherited from Element)
getCssPropertyValue(property, pseudoElement?) string Gets the value of a CSS property of the element.
(Inherited from Element)
getText() string Returns the text content of the element.
(Inherited from Element)
hasClass(cls) boolean Checks if the element has a class.
(Inherited from Element)
indexOf(other) number Returns the index of the node or -1 if the node is not found.
(Inherited from Element)
insertAfter(node, child) T Inserts a child node after the current node.
(Inherited from Element)
instanceOf(type) this is T Cross-window capable instanceof check, a drop-in replacement for instanceof checks on DOM Nodes. Remember to also check for nulls when necessary.
(Inherited from Element)
isActiveElement() boolean Checks if the element is the active element.
(Inherited from Element)
matchParent(selector, lastParent?) Element | null Matches the selector recursively up the DOM tree.
(Inherited from Element)
removeClass(classes?) void Removes a class from the element.
(Inherited from Element)
removeClasses(classes) void Removes multiple classes from the element.
(Inherited from Element)
setAttr(qualifiedName, value) void Sets an attribute on the element.
(Inherited from Element)
setAttrs(obj) void Sets multiple attributes on the element.
(Inherited from Element)
setChildrenInPlace(children) void Sets the children of the node.
(Inherited from Element)
setCssProps(props) void Sets the CSS properties of the element.
setCssStyles(styles) void Sets the CSS styles of the element.
setText(val) void Sets the text content of the element.
(Inherited from Element)
toggleClass(classes, value) void Toggles a class on the element.
(Inherited from Element)

Links to this page: