add functions to create js-objs from hickory

This commit is contained in:
bom 2021-10-08 16:23:35 +02:00
parent 5be6f866bc
commit 7c73735a64

View file

@ -67,12 +67,24 @@
(.-classList) (.-classList)
(.add "was-validated"))) (.add "was-validated")))
(defn replace-element-content (defn create-js-obj-from-html
[name [html-string]
content] (-> js/document
(-> (get-element-by-id name) .createRange
(.-innerHTML) (.createContextualFragment html-string)))
(set! (hr/hickory-to-html content))))
(defn append-to-body
[js-obj]
(-> js/document
.-body
(.appendChild js-obj)))
(defn append-hickory
[hickory-obj]
(-> hickory-obj
(hr/hickory-to-html)
(create-js-obj-from-html)
(append-to-body)))
(defn generate-feedback-tag (defn generate-feedback-tag
[id] [id]