package fmlib_js
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=987144e79a5ab8544a9cac669284ef7610a70c3362d4f55e5d27e4f33b49a1b9
doc/fmlib_js/Fmlib_js/Dom/Document/index.html
Module Dom.Document
val title : t -> string
The title of the document.
val set_title : string -> t -> unit
set_title str doc
Set the title of the document.
The body of the document.
Precondition: The document must have been loaded!
Never call this function before the page has been loaded.
find id doc
Find the element with the id attribute id
in the document doc
. Uses the javascript method getElementById
.
create_text_node text doc
Create a new text node with content text
.
create_element_ns namespace name doc
Like create_element
, but creates the element within a namespace, e.g. "http://www.w3.org/2000/svg".
Create a new document fragment.
A document fragment is a special node with no parent. Adding children to the fragment does not affect the dom i.e. does not cause reflow and repaint, because the fragment is not part of the active dom.
If you call
node.append(fragment)
all the children the fragment
are appended to node
instead of the fragment, leaving an empty fragment behind.