You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I might be missing the point, but I didn't see it the examples section.
What is the recommended approach with j2html for common DOM events?
Such as onclick, onhover etcetera
I find that I can achieve that with attr(name,value) but it doesn't show up intuitively (or rather I find myself trying lots of things before remembering.
Thanks in advance for creating such a fun library to work with in any case.
The text was updated successfully, but these errors were encountered:
I got here by searching exactly for this same, I think it does makes sense to have on click for buttons, as is it is still achievable to add them using the following syntax
button().attr("onClick=console.log('hi')")
Non the less having something as:
button().onClick("console.log('hi')")
would be nice preventing typos at least on the on click part and also facilitating using reflection to build html on the fly calling certain functions.
I also agree that js should be separate yet the calling to it can be done on HTML, this way preventing the need of having to do the linking on JS itself
I might be missing the point, but I didn't see it the examples section.
What is the recommended approach with j2html for common DOM events?
Such as onclick, onhover etcetera
I find that I can achieve that with attr(name,value) but it doesn't show up intuitively (or rather I find myself trying lots of things before remembering.
Thanks in advance for creating such a fun library to work with in any case.
The text was updated successfully, but these errors were encountered: