hickory
hickory copied to clipboard
event handlers
It seems I cannot attach event handlers
(-> {:type :element, :attrs {:onclick (fn [] (prn "click"))}, :tag :h1, :content [" hi "]} hickory-to-html )
onclick it seems must be a string. what if i want it to be a function?
I'm not sure what you're trying to do, but there is no hope of that code working; Hickory doesn't attempt to do anything like that. If you want that function to appear as the onclick element in the HTML, it has to be in a string. This is purely about working with the parsed representation of the text of HTML.
This is well outside the scope of this project. Check out hiccup