Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > d7bde520c46707c45a7f2ed5eb6d17d1 > files > 277

obrowser-doc-1.1.1-6.mga4.x86_64.rpm

open Js ;;

(* We retrieve the DOM Node with the id *)
let cdiv = get_element_by_id Sys.argv.(1) ;;

(* We use high level functions from Html encapsulating the imperative DOM processing *)
Node.append cdiv
  (Html.a
     (* the click callback *)         ~onclick:(fun () -> alert "Hello World")
     (* the children of the a Node *) [Html.string "Wakeup, little VM !"])
;;