How to find an element relative to the clicked element
I’m trying to use Hyperscript to find the nearest parent element with the class .foo
when a user clicks on any element inside a <div>
. Here’s what I have so far:
How to create an auto-resizing textarea in hyperscript
I have a textarea with a fixed width, and I want to make it auto-resize vertically when the text wraps or the user enters a new line.
scroll eventlistener in _hyperscript
I’m trying to log something to the console when the user scrolls using _hyperscript, but it doesn’t seem to be working, although other eventlisteners like ‘click’, and ‘touchstart’ are working.
This is the way I’m doing it:
<body _="on scroll alert('something')"> // content // </body>
Go to a url based on an expression
<input class=”new-item” name=”description” value=”” placeholder=”e.g. travel, backpacking, etc.” _=”on keyup[key is ‘Enter’] go to /checklists/{this.value}” enterkeyhint=”send” /> According to the docs the url requires a stringlike rather than an expression. How would you handle this? go [to] url <stringLike> [in new window] go [to] [top|middle|bottom] [left|center|right] [of] <expression> [(+|-) <number> [px] ][smoothly|instantly] go back https://hyperscript.org/commands/go/ […]