Class type Goog.​Gdom.​domHelper

class type domHelper = object..end

method appendChild : 
'a 'b. (#Dom.node as 'a) Js.t -> (#Dom.node as 'b) Js.t -> unit Js.meth

Appends a child to a node

method contains : 
'c 'd.
(#Dom.node as 'c) Js.t -> (#Dom.node as 'd) Js.t -> bool Js.t Js.meth

Whether a node contains another node t

method createDom : 
Js.js_string Js.t ->
Js.js_string Js.t Js.opt ->
Js.js_string Js.t Js.opt -> Dom_html.element Js.t Js.meth

Returns 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.

method createElement : Js.js_string Js.t -> Dom_html.element Js.t Js.meth

Creates a new element

method createTextNode : Js.js_string Js.t -> Dom.node Js.t Js.meth

Creates a new text node

method findNode : 
'e 'f.
(#Dom.node as 'e) Js.t ->
((#Dom.node as 'f) Js.t -> bool Js.t) -> Dom.node Js.t Js.meth

Finds the first descendant node that matches the filter function. This does a depth first search.

method flattenElement : 
'g. (#Dom_html.element as 'g) Js.t -> Dom_html.element Js.t Js.meth

Flattens an element. That is, removes it and replace it with its children

method getAncestor : 
'h 'i.
(#Dom.node as 'h) Js.t ->
((#Dom.node as 'i) Js.t -> bool Js.t) ->
bool Js.t -> int Js.opt -> Dom.node Js.t Js.meth

Walks up the DOM hierarchy returning the first ancestor that passes the matcher function.

method getAncestorByTagNameAndClass : 
'j.
(#Dom.node as 'j) Js.t ->
Js.js_string Js.t -> Js.js_string Js.t -> Dom.node Js.t Js.meth

Walks up the DOM hierarchy returning the first ancestor that has the passed tag name and/or class name. If the passed element matches the specified criteria, the element itself is returned.

method getCompatMode : Js.js_string Js.t Js.meth

Returns the compatMode of the document

method getDocument : document Js.meth

Returns the compatMode of the document

method getDocumentHeight : int Js.meth

Calculates the height of the document

method getDocumentScroll : Goog.Math.coordinate Js.t Js.meth

Gets the document scroll distance as a coordinate object *

method getDocumentScrollElement : Dom_html.element Js.t Js.meth

Gets the document scroll element *

method getDomHelper : 
'k. (#Dom.node as 'k) Js.t -> domHelper Js.t Js.meth

Gets the DomHelper object for the document where the element resides

method getElement : 
'l.
((#Dom_html.element as 'l) Js.t, Js.js_string Js.t) Goog.Tools.Union.t ->
Dom_html.element Js.t Js.meth

Return the element with the given ID *

method getElementByTagNameAndClass : 
'm.
Js.js_string Js.t ->
Js.js_string Js.t -> (#Dom_html.element as 'm) Js.t -> int Js.meth

Looks up elements by both tag and class name, using browser native functions (querySelectorAll, getElementsByTagName or getElementsByClassName) where possible. The returned array is a live NodeList or a static list depending on the code path taken.

method getFirstElementChild : 
'n. (#Dom.node as 'n) Js.t -> Dom.node Js.t Js.meth

Returns the first child node that is an element

method getFrameContentDocument : 
'o. (#Dom_html.element as 'o) Js.t -> Dom_html.element Js.t Js.meth

Cross browser function for getting the document element of an iframe

method getLastElementChild : 
'p. (#Dom.node as 'p) Js.t -> Dom_html.element Js.t Js.meth

Returns the last child node that is an element

method getNextElementSibling : 
'q. (#Dom.node as 'q) Js.t -> Dom_html.element Js.t Js.meth

Returns the first next sibling that is an element

method getNextNode : 'r. (#Dom.node as 'r) Js.t -> Dom.node Js.t Js.meth

Returns the next node in source order from the given node *

method getNodeTextLength : 's. (#Dom.node as 's) Js.t -> int Js.meth

Returns the text length of the text contained in a node, without markup. This is equivalent to the selection length if the node was selected, or the number of cursor movements to traverse the node. Images & BRs take one space. New lines are ignored.

method getNodeTextOffset : 
't 'u. (#Dom.node as 't) Js.t -> (#Dom.node as 'u) Js.t -> int Js.meth

Returns the text offset of a node relative to one of its ancestors. The text length is the same as the length calculated by goog.dom.getNodeTextLength.

method getOwnerDocument : 
'v. (#Dom.node as 'v) Js.t -> Dom_html.element Js.t Js.meth

Returns the owner document for a node.

method getPreviousElementSibling : 
'w. (#Dom.node as 'w) Js.t -> Dom_html.element Js.t Js.meth

Returns the first previous sibling that is an element *

method getPreviousNode : 
'x. (#Dom.node as 'x) Js.t -> Dom_html.element Js.t Js.meth

Returns the previous node in source order from the given node.

method getTextContent : 
'y. (#Dom.node as 'y) Js.t -> Js.js_string Js.t Js.meth

Returns the text content of the current node, without markup and invisible symbols. New lines are stripped and whitespace is collapsed, such that each character would be visible. In browsers that support it, innerText is used. Other browsers attempt to simulate it via node traversal. Line breaks are canonicalized in IE.

method getViewportSize : window Js.t -> size Js.t Js.meth

Gets the dimensions of the viewport.

method getWindow : window Js.t Js.meth

Gets the window object associated with the document.

method htmlToDocumentFragment : Js.js_string Js.t -> Dom.node Js.t Js.meth

Converts an HTML js_string Js.t into a document fragment.

method insertSiblingAfter : 
'z. (#Dom.node as 'z) Js.t -> Dom.node Js.t Js.meth

Inserts a new node after an existing reference node (i.e., as the next sibling). If the reference node has no parent, then does nothing.

method insertSiblingBefore : 
'a1. (#Dom.node as 'a1) Js.t -> Dom.node Js.t Js.meth

Inserts a new node before an existing reference node (i.e., as the next sibling). If the reference node has no parent, then does nothing.

method isCss1CompatMode : bool Js.t Js.meth

Returns true if the browser is in "CSS1-compatible" (standards-compliant) mode, false otherwise.

method isNodeLike : 'b1. (#Dom.node as 'b1) Js.t -> bool Js.t Js.meth

Whether the object looks like a DOM node.

method removeChildren : 'c1. (#Dom.node as 'c1) Js.t -> unit Js.meth

Removes all the child nodes on a DOM node.

method removeNode : 'd1. (#Dom.node as 'd1) Js.t -> Dom.node Js.t Js.meth

Removes a node from its parent.

method replaceNode : 
'e1 'f1.
(#Dom.node as 'e1) Js.t -> (#Dom.node as 'f1) Js.t -> unit Js.meth

Replaces a node in the DOM tree. Will do nothing if oldNode has no parent.

method setDocument : document -> unit Js.meth

Sets the document object.

method setProperties : 
'g1 'h1.
(#Dom_html.element as 'g1) Js.t ->
(#Dom_html.element as 'h1) Js.t -> unit Js.meth

Sets a number of properties on a node.

method setTextContent : 
'i1. (#Dom_html.element as 'i1) Js.t -> Js.js_string Js.t -> unit Js.meth

Cross browser function for setting the text content of an element.