Skip to main content
Version: 9.0.0

Selector API properties

All properties are returned as a Promise.

Promise: Represents the completion of an asynchronous operation

PropertyTypeDescription
idstringString representing the id of the element.
tagNamestringString with the name of the tag for the given element.
nodeTypenumberNumber matching the node type.
namespaceURIstring / nullNamespace URI of the element, or null if it is no namespace.
classNamestringString representing the class of the element.
classNamesstring[]Array of string representing the class of the element.
focusedbooleanReturns true if element is focused.
visiblebooleanReturns true if element is visible.
attachedbooleanReturns true if element is attached.
stablebooleanReturns true if element is stable.
editablebooleanReturns true if element is editable.
clickablebooleanReturns true if element is clickable.
inViewportbooleanReturns true if element is in viewport.
inViewportPartiallybooleanReturns true if element is partially in viewport.
enabledbooleanReturns true if element is enabled.
disabledbooleanReturns true if element is disabled.
existsbooleanReturns true if element exists.
countnumberNumber of elements matching this selector.
checkedboolean / undefinedReturns true if element is checked or undefined if element does not have such property.
selectedboolean / undefinedReturns true if element is selected or undefined if element does not have such property.
selectedIndexnumber / undefinedIndex of the currently selected option.
valuestring / undefinedSelector value or undefined if no value.
nodeValuestring / nullValue of the current node or null if no value.
textContentstringText content of the node and its descendants.
innerTextstringRendered text content of a node and its descendants.
innerHTMLstringString representing the markup of the element's content.
outerHTMLstringString representing the markup of the element including its content.
style[prop: string]: stringInline style of an element in the form of an array that contains a list of all styles properties for that element with values assigned for the attributes.
childElementCountnumberNumber of child elements of this element.
childNodeCountnumberNumber of child nodes of the given element.
hasChildElementsbooleanReturns trueif element has child elements.
hasChildNodesbooleanReturns trueif element has child nodes.
attributes[name: string]: stringArray of all attribute nodes registered to the specified node.
clientHeightnumberInner height of an element in pixels.
clientLeftnumberInner height of an element in pixels.
clientTopnumberWidth of the left border of an element in pixels.
clientWidthnumberInner width of an element in pixels
offsetHeightnumberHeight of an element, including vertical padding and borders, as an integer.
offsetLeftnumberNumber of pixels that the upper left corner of the current element is offset to the left within the closest positioned ancestor element.
offsetTopnumberDistance of the outer border of the current element relative to the inner border of the top of the closest positioned ancestor element.
offsetWidthnumberLayout width of an element as an integer
scrollHeightnumberMeasurement of the height of an element's content, including content not visible on the screen due to overflow.
scrollLeftnumberNumber of pixels that an element's content is scrolled from its left edge.
scrollTopnumberNumber of pixels that an element's content is scrolled vertically.
scrollWidthnumberMeasurement of the width of an element's content, including content not visible on the screen due to overflow.
boundingClientRectTextRectangleReturns a TextRectangle object providing information about the size of an element and its position relative to the viewport.

TextRectangle

interface TextRectangle {
bottom: number;
left: number;
right: number;
top: number;
width: number;
height: number;
}