aboutsummaryrefslogtreecommitdiff
path: root/src/Lib/Dom/Document.ml
diff options
context:
space:
mode:
authorJoris2020-07-13 21:30:32 +0200
committerJoris2020-07-13 21:30:32 +0200
commitd1135ff55db85ef81bbe2bd8f283cdbbd5464298 (patch)
treea971c4d88b862b21ca2263c6c48b053d64c9b125 /src/Lib/Dom/Document.ml
parent73a9d499c9e3709d99d61bbbbf412611a5c503b9 (diff)
Show map and add marks with right click
Diffstat (limited to 'src/Lib/Dom/Document.ml')
-rw-r--r--src/Lib/Dom/Document.ml14
1 files changed, 14 insertions, 0 deletions
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"]