/src/ocamljs-sanity/main.ml

http://github.com/hhughes/ocaml-frui · OCaml · 10 lines · 8 code · 2 blank · 0 comment · 0 complexity · 36074cc2bc8d7612613ec239540ed82e MD5 · raw file

  1. module D = Dom
  2. let onload () =
  3. let main = (D.document#getElementById "main" : D.element) in
  4. let text = (D.document#createTextNode "hw_text" : D.text) in
  5. text#_set_data "Hello World!";
  6. ignore (main#appendChild text)
  7. ;;
  8. D.window#_set_onload onload