@JsType(isNative=true, name="Element", namespace="<global>") public abstract class BaseElement extends BaseNode
BaseEventTarget.EventListenerCallback
Modifier and Type | Method and Description |
---|---|
NamedNodeMap<BaseAttribute> |
getAttributes()
Returns a collection of all attribute nodes registered to the specified node.
|
int |
getChildElementCount()
Returns the number of children of this element which are elements.
|
int |
getClientHeight()
Returns a number representing the inner height of the element.
|
int |
getClientLeft()
Returns a number representing the width of the left border of the element.
|
int |
getClientTop()
Returns a number representing the width of the top border of the element.
|
int |
getClientWidth()
Returns a number representing the inner width of the element.
|
NodeList<BaseElement> |
getElementsByTagName(String tagname)
Returns a list containing all descendant elements, of a particular tag name, from the current element.
|
BaseElement |
getFirstElementChild()
Returns the first node which is both a child of this element and is also an element, or
null if there is none. |
String |
getId()
Returns the unique id of the element.
|
String |
getInnerHTML()
Returns the markup of the element's content.
|
BaseElement |
getLastElementChild()
Returns the last node which is both a child of this element and is an element, or
null if there is none. |
BaseElement |
getNextElementSibling()
Returns the element immediately following the given one in the tree, or
null if there's no sibling node. |
String |
getOuterHTML()
Returns the serialized HTML fragment describing the element including its descendants.
|
BaseElement |
getPreviousElementSibling()
Returns the element immediately preceding the given one in the tree, or
null if there is no sibling element. |
int |
getScrollHeight()
Returns a number representing the scroll view height of an element.
|
double |
getScrollLeft()
Returns a number representing the left scroll offset of the element.
|
double |
getScrollTop()
Returns a number representing number of pixels the top of the document is scrolled vertically.
|
int |
getScrollWidth()
Returns a number representing the scroll view width of the element.
|
String |
getTagName()
Returns the name of the tag for the given element.
|
boolean |
hasAttributes()
Returns a boolean indicating whether the current element has any attributes or not.
|
void |
remove()
Removes the element from the children list of its parent.
|
void |
setId(String id)
Sets the unique id of the element.
|
void |
setInnerHTML(String innerHTML)
Sets the markup of the element's content..
|
appendChild, cloneNode, getChildNodes, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPreviousSibling, getTextContent, hasChildNodes, insertBefore, removeAllChildren, removeChild, setNodeValue, setTextContent
addEventListener, removeEventListener
@JsProperty public final int getChildElementCount()
@JsProperty public final int getClientHeight()
@JsProperty public final int getClientLeft()
@JsProperty public final int getClientTop()
@JsProperty public final int getClientWidth()
@JsProperty public final BaseElement getFirstElementChild()
null
if there is none.null
if there is none@JsProperty public final String getId()
@JsProperty public final void setId(String id)
id
- the unique id of the element@JsProperty public final String getInnerHTML()
@JsProperty public final void setInnerHTML(String innerHTML)
innerHTML
- the markup of the element's content@JsProperty public final String getOuterHTML()
@JsProperty public final BaseElement getLastElementChild()
null
if there is none.null
if there is none@JsProperty public final BaseElement getNextElementSibling()
null
if there's no sibling node.null
if there's no sibling node@JsProperty public final BaseElement getPreviousElementSibling()
null
if there is no sibling element.null
if there is no sibling element@JsProperty public final int getScrollHeight()
@JsProperty public final double getScrollLeft()
@JsProperty public final double getScrollTop()
@JsProperty public final int getScrollWidth()
@JsProperty public final String getTagName()
@JsProperty public NamedNodeMap<BaseAttribute> getAttributes()
@JsMethod public final NodeList<BaseElement> getElementsByTagName(String tagname)
tagname
- the qualified name to look for. The special string "*" represents all elements.@JsMethod public final void remove()
@JsMethod public final boolean hasAttributes()
true
whether the current element has any attributes