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)
(.add "was-validated")))
(defn replace-element-content
[name
content]
(-> (get-element-by-id name)
(.-innerHTML)
(set! (hr/hickory-to-html content))))
(defn create-js-obj-from-html
[html-string]
(-> js/document
.createRange
(.createContextualFragment html-string)))
(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
[id]