Create an instance of a DOM helper with a new document object.
| Instance Method Summary | |
createDom(string tagName, (Object|null|string=) opt_attributes, (goog.dom.Appendable|null|undefined) var_args) ⇒ !ElementReturns a dom node with a set of attributes. This function accepts varargs
for subsequent nodes to be added. Subsequent nodes will be added to the
first node as childNodes.
So:
| |
createElement(string name) ⇒ !ElementCreates a new element. | |
createTable(number rows, number columns, boolean= opt_fillWithNbsp) ⇒ !ElementCreate a table. | |
createTextNode(string content) ⇒ !TextCreates a new text node. | |
getCompatMode() ⇒ stringReturns the compatMode of the document. | |
getDocument() ⇒ !DocumentGets the document object being used by the dom library. | |
getDocumentHeight() ⇒ numberCalculates the height of the document. | |
getDocumentScroll() ⇒ !goog.math.CoordinateGets the document scroll distance as a coordinate object. | |
getDocumentScrollElement() ⇒ ?ElementGets the document scroll element. | |
getElement((Element|null|string) element) ⇒ ?ElementAlias for {@code getElementById}. If a DOM node is passed in then we just return that. | |
getElementByClass(string className, (Document|Element|null=) opt_el) ⇒ ?ElementReturns the first element we find matching the provided class name. | |
getElementsByClass(string className, (Document|Element|null=) opt_el) ⇒ {length: number}Returns an array of all the elements with the provided className. | |
getElementsByTagNameAndClass(?string= opt_tag, ?string= opt_class, (Document|Element|null=) opt_el) ⇒ {length: number}Looks up elements by both tag and class name, using browser native functions ({@code querySelectorAll}, {@code getElementsByTagName} or {@code getElementsByClassName}) where possible. The returned array is a live NodeList or a static list depending on the code path taken. | |
getViewportSize(?Window= opt_window) ⇒ !goog.math.SizeGets the dimensions of the viewport. | |
getWindow() ⇒ !WindowGets the window object associated with the document. | |
htmlToDocumentFragment(string htmlString) ⇒ !NodeConverts an HTML string into a node or a document fragment. A single Node is used if the {@code htmlString} only generates a single node. If the {@code htmlString} generates multiple nodes then these are put inside a {@code DocumentFragment}. | |
isCss1CompatMode() ⇒ booleanReturns true if the browser is in "CSS1-compatible" (standards-compliant) mode, false otherwise. | |
setDocument(!Document document)Sets the document object. | |