Element
Extends: Node
See: https://developer.mozilla.org/en-US/docs/Web/API/Element
- Element
- new Element(document, nodeName, namespaceURI)
- .nodeName :
string
- .localName :
string
- .tagName :
string
- .nodeType :
number
- .namespaceURI :
string
- .id :
string
- .tabIndex :
number
- .className :
string
- .attributes :
NamedNodeMap
- .style :
Style
- .clientLeft :
number
- .clientTop :
number
- .clientWidth :
number
- .clientHeight :
number
- .height :
string
orNumber
- .width :
string
orNumber
- .offsetParent :
Element
- .offsetLeft :
number
- .offsetTop :
number
- .offsetWidth :
number
- .offsetHeight :
number
- .scrollLeft :
number
- .scrollTop :
number
- .scrollWidth :
number
- .scrollHeight :
number
- .uxpContainer :
UXPContainer
- .disabled :
boolean
- .innerHTML :
string
- .outerHTML :
string
- .contentEditable
- .isConnected :
boolean
- .parentNode :
Node
- .parentElement :
Element
- .firstChild :
Node
- .lastChild :
Node
- .previousSibling :
Node
- .nextSibling :
Node
- .firstElementChild :
Node
- .lastElementChild :
Node
- .previousElementSibling :
Node
- .nextElementSibling :
Node
- .textContent :
string
- .childNodes :
NodeList
- .children :
HTMLCollection
- .ownerDocument
- .scrollIntoView()
- .scrollIntoViewIfNeeded()
- .focus()
- .blur()
- .getAttribute(name)
- .setAttribute(name, value)
- .removeAttribute(name)
- .hasAttribute(name)
- .getAttributeNode(name)
- .setAttributeNode(newAttr)
- .removeAttributeNode(oldAttr)
- .click()
- .getElementsByClassName(name)
- .getElementsByTagName(name)
- .querySelector(selector)
- .querySelectorAll(selector)
- .getBoundingClientRect()
- .insertAdjacentHTML(position, value)
- .insertAdjacentElement(position, node)
- .insertAdjacentText(position, text)
- .hasChildNodes()
- .cloneNode(deep)
- .appendChild(child)
- .insertBefore(child, before)
- .replaceChild(newChild, oldChild)
- .removeChild(child)
- .remove()
- .before(...nodes)
- .after(...nodes)
- .replaceWith(...nodes)
- .contains(node)
- .addEventListener(eventName, callback, [capture])
- .removeEventListener(eventName, callback, [capture])
- .dispatchEvent(event)
new Element(document, nodeName, namespaceURI)
Creates an instance of Element.
Param | Type |
---|---|
document | * |
nodeName | * |
namespaceURI | * |
element.nodeName : string
Read only
element.localName : string
Read only
element.tagName : string
Read only
element.nodeType : number
Read only
element.namespaceURI : string
Read only
element.id : string
element.tabIndex : number
element.className : string
element.attributes : NamedNodeMap
Overrides: attributes
Read only
element.style : Style
Read only
element.clientLeft : number
Read only
element.clientTop : number
Read only
element.clientWidth : number
Read only
element.clientHeight : number
Read only
element.height : string
or Number
The height of the element
element.width : string
or Number
The width of the element
element.offsetParent : Element
Read only
element.offsetLeft : number
Read only
element.offsetTop : number
Read only
element.offsetWidth : number
Read only
element.offsetHeight : number
Read only
element.scrollLeft : number
element.scrollTop : number
element.scrollWidth : number
Read only
element.scrollHeight : number
Read only
element.uxpContainer : UXPContainer
Read only
element.disabled : boolean
element.innerHTML : string
element.outerHTML : string
element.contentEditable
Read only
element.isConnected : boolean
Read only
element.parentNode : Node
Read only
element.parentElement : Element
Read only
element.firstChild : Node
Read only
element.lastChild : Node
Read only
element.previousSibling : Node
Read only
element.nextSibling : Node
Read only
element.firstElementChild : Node
Read only
element.lastElementChild : Node
Read only
element.previousElementSibling : Node
Read only
element.nextElementSibling : Node
Read only
element.textContent : string
element.childNodes : NodeList
Read only
element.children : HTMLCollection
Read only
element.ownerDocument
Read only
element.scrollIntoView()
element.scrollIntoViewIfNeeded()
element.focus()
element.blur()
element.getAttribute(name)
Param | Type |
---|---|
name | string |
element.setAttribute(name, value)
Param | Type |
---|---|
name | string |
value | string |
element.removeAttribute(name)
Param | Type |
---|---|
name | string |
element.hasAttribute(name)
Param | Type |
---|---|
name | string |
element.getAttributeNode(name)
Param | Type |
---|---|
name | string |
element.setAttributeNode(newAttr)
Param | Type |
---|---|
newAttr | * |
element.removeAttributeNode(oldAttr)
Param | Type |
---|---|
oldAttr | * |
element.click()
element.getElementsByClassName(name)
Param | Type |
---|---|
name | string |
element.getElementsByTagName(name)
Param | Type |
---|---|
name | string |
element.querySelector(selector)
Param | Type |
---|---|
selector | string |
element.querySelectorAll(selector)
Param | Type |
---|---|
selector | string |
element.getBoundingClientRect()
element.insertAdjacentHTML(position, value)
Param | Type |
---|---|
position | |
value | string |
element.insertAdjacentElement(position, node)
Param | Type |
---|---|
position | * |
node | * |
element.insertAdjacentText(position, text)
Param | Type |
---|---|
position | * |
text | * |
element.hasChildNodes()
element.cloneNode(deep)
Param | Type |
---|---|
deep | boolean |
element.appendChild(child)
Param | Type |
---|---|
child | Node |
element.insertBefore(child, before)
Param | Type |
---|---|
child | Node |
before | Node |
element.replaceChild(newChild, oldChild)
Param | Type |
---|---|
newChild | Node |
oldChild | Node |
element.removeChild(child)
Param | Type |
---|---|
child | Node |
element.remove()
element.before(...nodes)
Param | Type |
---|---|
...nodes | Array.<Node> |
element.after(...nodes)
Param | Type |
---|---|
...nodes | Array.<Node> |
element.replaceWith(...nodes)
Param | Type |
---|---|
...nodes | Array.<Node> |
element.contains(node)
Param | Type |
---|---|
node | Node |
element.addEventListener(eventName, callback, [capture])
Param | Type | Default |
---|---|---|
eventName | * |
|
callback | * |
|
[capture] | boolean |
false |
element.removeEventListener(eventName, callback, [capture])
Param | Type | Default |
---|---|---|
eventName | * |
|
callback | * |
|
[capture] | boolean |
false |
element.dispatchEvent(event)
Param | Type |
---|---|
event | * |