hickory icon indicating copy to clipboard operation
hickory copied to clipboard

event handlers

Open sonwh98 opened this issue 8 years ago • 1 comments

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?

sonwh98 avatar Apr 27 '17 09:04 sonwh98

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.

davidsantiago avatar Apr 27 '17 18:04 davidsantiago

This is well outside the scope of this project. Check out hiccup

port19x avatar Apr 11 '23 08:04 port19x