public interface Document extends Node, NodeSelector
Modifier and Type | Interface and Description |
---|---|
static class |
Document.DocumentUtil |
Modifier and Type | Method and Description |
---|---|
<T> T |
createElement(java.lang.String tag)
Creates the specified HTML element or an HTMLUnknownElement if the given element name isn't a known
one.
|
Element |
getBody() |
Element |
getElementById(java.lang.String id)
Returns an object reference to the identified element.
|
NodeList |
getElementsByClassName(java.lang.String tagname)
Returns an array-like object of all child elements which have all of the given class names.
|
NodeList |
getElementsByName(java.lang.String elementName)
Returns a NodeList collection with a given name in the (X)HTML document.
|
NodeList |
getElementsByTagName(java.lang.String tagname)
Returns an NodeList of elements with the given tag name.
|
Element |
getHead() |
appendChild, getChildNodes, getFirstChild, getInnerText, getLastChild, getParentElement, getParentNode, getTextContent, hasChildNodes, insertBefore, removeChild, replaceChild, setInnerText, setTextContent
addEventListener, dispatchEvent, removeEventListener
querySelector, querySelectorAll
Element getHead()
Element getBody()
Element getElementById(java.lang.String id)
id
- A case-sensitive string representing the unique ID of the elementNodeList getElementsByClassName(java.lang.String tagname)
tagname
- A string representing the list of class names to match; class names are separated by
whitespaceNodeList getElementsByName(java.lang.String elementName)
elementName
- The value of the name attribute of the element.NodeList getElementsByTagName(java.lang.String tagname)
tagname
- A string representing the name of the elements. The special string "*" represents all
elements<T> T createElement(java.lang.String tag)
tag
- Is a string that specifies the type of element to be created. The nodeName of the created
element is initialized with the value of tagName. Don't use qualified names (like "html:a")
with this method.