From d1135ff55db85ef81bbe2bd8f283cdbbd5464298 Mon Sep 17 00:00:00 2001 From: Joris Date: Mon, 13 Jul 2020 21:30:32 +0200 Subject: Show map and add marks with right click --- src/Lib/Dom/Document.ml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/Lib/Dom/Document.ml (limited to 'src/Lib/Dom/Document.ml') diff --git a/src/Lib/Dom/Document.ml b/src/Lib/Dom/Document.ml new file mode 100644 index 0000000..867e28c --- /dev/null +++ b/src/Lib/Dom/Document.ml @@ -0,0 +1,14 @@ +external createElement : string -> Dom.element = "createElement" + [@@bs.val] [@@bs.scope "document"] + +external createElementNS : string -> string -> Dom.element = "createElementNS" + [@@bs.val] [@@bs.scope "document"] + +external querySelector : string -> Dom.element Js.Nullable.t = "querySelector" + [@@bs.val] [@@bs.scope "document"] + +let querySelectorUnsafe id = + querySelector id |> Js.Nullable.toOption |> Js.Option.getExn + +external createTextNode : string -> Dom.element = "createTextNode" + [@@bs.val] [@@bs.scope "document"] -- cgit v1.2.3