public interface DOMDocument extends DOMEventTarget
Modifier and Type | Method and Description |
---|---|
DOMText |
createTextNode(java.lang.String nodeText) |
DOMElement |
getBody()
Returns
BODY element of this document. |
DOMElement |
getDocumentElement()
Returns topmost HTML element in the current document.
|
DOMElement |
getElementById(java.lang.String elementId)
Returns first HTML element in this document with
ID attribute equals to elementId or
null if document doesn't contains HTML element with passed ID attribute. |
DOMNodeList |
getElementsByName(java.lang.String name)
Returns list of HTML elements with the
name attribute. |
DOMNodeList |
getElementsByTagName(java.lang.String tagName)
Returns list of HTML elements with the
tagName . |
java.lang.String |
getTitle()
Returns the title of this document.
|
java.lang.String |
getURL()
Returns URL of this document.
|
void |
setTitle(java.lang.String title)
Sets a new title for this document.
|
addEventListener, removeEventListener
java.lang.String getTitle()
void setTitle(java.lang.String title)
title
- a new title for this document.java.lang.String getURL()
DOMElement getBody()
BODY
element of this document.BODY
element of this document.DOMNodeList getElementsByName(java.lang.String name)
name
attribute.name
- the name
attribute value.name
were found.DOMElement getDocumentElement()
DOMNodeList getElementsByTagName(java.lang.String tagName)
tagName
.tagName
- the tag name.DOMElement getElementById(java.lang.String elementId)
ID
attribute equals to elementId
or
null
if document doesn't contains HTML element with passed ID attribute.elementId
- element's ID attribute value.null
.DOMText createTextNode(java.lang.String nodeText)