.TH "Eliom_content.Html5.Manip" 3o 2014-07-10 OCamldoc "" .SH NAME Eliom_content.Html5.Manip \- DOM-like manipulation functions. .SH Module Module Eliom_content.Html5.Manip .SH Documentation .sp Module .BI "Manip" : .B sig end .sp DOM\-like manipulation functions\&. .sp In this module, all the functions apply only to HTML5 element with \&. .sp .sp .sp .sp .I val appendChild : .B ?before:'a Eliom_content.Html5.elt -> .B 'b Eliom_content.Html5.elt -> 'c Eliom_content.Html5.elt -> unit .sp The function .B appendChild e1 e2 inserts the element .B e2 as last child of .B e1 \&. If the optional parameter .B ~before:e3 is present and if .B e3 is a child of .B e1 , then .B e2 is inserted before .B e3 in the list of .B e1 children\&. .sp .sp .I val appendToBody : .B ?before:'a Eliom_content.Html5.elt -> 'c Eliom_content.Html5.elt -> unit .sp Append to the body of the document\&. .sp .sp .I val appendChildren : .B ?before:'a Eliom_content.Html5.elt -> .B 'b Eliom_content.Html5.elt -> 'c Eliom_content.Html5.elt list -> unit .sp The function .B appendChildren e1 elts inserts .B elts as last children of .B e1 \&. If the optional parameter .B ~before:e3 is present and if .B e3 is a child of .B e1 , then .B elts are inserted before .B e3 in the list of .B e1 children\&. .sp .sp .I val appendChildFirst : .B 'b Eliom_content.Html5.elt -> 'c Eliom_content.Html5.elt -> unit .sp .B appendChildFirst p c appends .B c as first child of .B p .sp .sp .I val nth : .B 'a Eliom_content.Html5.elt -> int -> 'b Eliom_content.Html5.elt option .sp .B nth e n returns the nth child of .B e (first is 0) .sp .sp .I val childLength : .B 'a Eliom_content.Html5.elt -> int .sp .B childLength e returns the number of chilren of .B e .sp .sp .I val removeChild : .B 'a Eliom_content.Html5.elt -> 'b Eliom_content.Html5.elt -> unit .sp The function .B removeChild e1 e2 removes for .B e2 from the list of .B e1 children\&. .sp .sp .I val replaceChild : .B 'a Eliom_content.Html5.elt -> .B 'b Eliom_content.Html5.elt -> 'c Eliom_content.Html5.elt -> unit .sp The function .B replace e1 e2 e3 replaces for .B e2 by .B e3 in the list of .B e1 children\&. .sp .sp .I val removeChildren : .B 'a Eliom_content.Html5.elt -> unit .sp The function .B removeChildren e1 removes .B e1 children\&. .sp .sp .I val removeSelf : .B 'a Eliom_content.Html5.elt -> unit .sp .B removeSelf e removes element e from the DOM\&. .sp .sp .I val replaceChildren : .B 'a Eliom_content.Html5.elt -> 'b Eliom_content.Html5.elt list -> unit .sp The function .B replaceChildren e1 elts replaces all the children of .B e1 by .B elt \&. .sp .sp .I val addEventListener : .B ?capture:bool -> .B 'a Eliom_content.Html5.elt -> .B (#Dom_html.event as 'b) Js.t Dom_html.Event.typ -> .B ('a Eliom_content.Html5.elt -> 'b Js.t -> bool) -> Dom_html.event_listener_id .sp The function .B addEventListener elt evt handler attach the .B handler for the event .B evt on the element .B elt \&. See the Js_of_ocaml manual, for a list of \&. .sp .sp .I module Named : .B sig end .sp Dom manipulation by element identifier\&. .sp .sp .I val scrollIntoView : .B ?bottom:bool -> 'a Eliom_content.Html5.elt -> unit .sp The function .B scrollIntoView elt scroll the page to a position where .B elt is displayed at the top of the window\&. If the optional parameter .B ~bottom:true is present, the page is scrolled to a position where .B elt is displayed at the bottom of the window\&. .sp .sp .I module Class : .B sig end .sp .sp .I module Elt : .B sig end .sp .sp .I module Ev : .B sig end .sp .sp .I module Attr : .B sig end .sp .sp .I module Css : .B sig end .sp Read the CSS properties of DOM elements\&. .sp .sp .I module SetCss : .B sig end .sp Modify the CSS properties of DOM elements\&. .sp .sp