_hyperscript
_hyperscript copied to clipboard
Practical example for converting Form data to JSON object?
I've searched quite a bit, but I can't seem to find a practical example for converting form data to JSON:
Docs: https://hyperscript.org/docs/#conversions
Values - converts a Form (or other element) into a struct containing its input names/values
I've been playing around with this, but I can't get it to work and now it feels like I'm just guessing. 😅
<div _="on click get the (value of #rightCol) as Values and put it into #resp">click me</div>
In the above code
#rightColis the id assigned to a<form>tag.#respis just a blank<div id="resp"></div>
I started with this, which works, and was trying to building off of it:
<div _="on click put 'hello' into #resp">click me</div>