aboutsummaryrefslogtreecommitdiff
path: root/src/Lib/Dom/Document.ml
blob: 46f983aab9cb23c190b50cec5967bb42867cff06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
external body : Dom.element = "body"
  [@@bs.val] [@@bs.scope "document"]

external create_element : string -> Dom.element = "createElement"
  [@@bs.val] [@@bs.scope "document"]

external create_element_ns : string -> string -> Dom.element = "createElementNS"
  [@@bs.val] [@@bs.scope "document"]

external query_selector : string -> Dom.element Js.Nullable.t = "querySelector"
  [@@bs.val] [@@bs.scope "document"]

let query_selector_unsafe id =
  query_selector id |> Js.Nullable.toOption |> Js.Option.getExn

external create_text_node : string -> Dom.element = "createTextNode"
  [@@bs.val] [@@bs.scope "document"]

external location : Location.location = "location"
  [@@bs.val] [@@bs.scope "document"]