Questions tagged [hyperscript]

This tag is used for questions relating to hyperscript (https://hyperscript.org/).

hyperscript

"An easy & approachable language for modern web front-ends"

Links:

23 questions
4
votes
1 answer

How to catch keyboard events in Cycle.js?

I'm trying to get hold of when the user presses the Escape key with my app open (so not necessarily with an input field focussed). So far, however, I'm stuck at intercepting keyboard events at all. This is what I'm currently…
Vincent
  • 4,876
  • 3
  • 44
  • 55
3
votes
2 answers

Enable submit button when all input fields are valid in Hyperscript?

I'm playing around with htmx and hyperscript and I want the "submit button" (Add User) to be enabled when all required input fields are valid in a form. In this case, a non-empty name and a valid email address must have been defined.
Johan
  • 37,479
  • 32
  • 149
  • 237
3
votes
1 answer

Clear all input fields on submit using Hyperscript

I'm playing around with htmx and hyperscript, and I want all input fields in the form below to be cleared on submit:
Johan
  • 37,479
  • 32
  • 149
  • 237
2
votes
2 answers

Make a clone of html element in _hyperscript

How to make a clone of html element in _hyperscript? For example, I want to see a copy of a button after clicking on it. Something like:
2
votes
1 answer

How to stop hyperscript from overwriting my inputs ? Peryl

My problem is in an application form I am making where a lot of inputs needs to be filled. I am generating HTML using Hyperscript and I run into a problem where when I generate more elements into a page I lose information from inputs but only in a…
Radovan Babjak
  • 80
  • 1
  • 10
1
vote
2 answers

Select all checkboxes using hyperscript

I'm trying to select all checkbox from a click event on a button, but I cannot found a way to do it propertly, here is the best code that I can think of:

Tiago
  • 2,871
  • 4
  • 23
  • 39
1
vote
1 answer

HTMX: How to update hx-delete url dynamically?

In order to build a modal to confirm a delete action, I'm trying to dynamically set a delete url, using hyperscript. Here is the (partial) code:
1
vote
1 answer

hyperscript equvelant of jquery .on("click"

$( document ).ready(function() { console.log( "ready!" ); var counter = 0; $("button").click(function() { e="

click me

" $("h2").append(e) …
Mzq
  • 1,796
  • 4
  • 30
  • 65
1
vote
1 answer

How to send an event to a element in a relative position of the current element

I have a list of elements with the class .node-display, when one is clicked it becomes an input. I want to capture the down or up arrow keyups to click the very next .node-display in the list (relative to the current element). In the below example,…
Timmerop
  • 35
  • 1
  • 7
1
vote
0 answers

What's the relationship between snabdom, hyperscript and Vue 2?

I'm trying to understand Vue with more depth and have done some reading about Vue 2's virtual DOM implementation and came across the mentions of snabdom and hyperscript. My understanding is that Vue 2 uses a fork of snabdom to implement its virtual…
Mysterywood
  • 1,378
  • 2
  • 10
  • 19
1
vote
1 answer

Can I use HyperX with Snabbdom

HyperX is a module that translates a tagged template literal to a hyperscript function like the one included with virtual-dom. Snabbdom uses a hyperscript-like function to build it's vdoms, but it's second argument is different. Instead of…
Jesse Hattabaugh
  • 7,876
  • 8
  • 34
  • 38
1
vote
1 answer

How to wire up virtual-hyperscript, hyperscript-helpers, and main-loop

I'm looking at an example by substack of using hyperscript, main-loop, and hyperx. I'd like to recreate this example using hyperscript-helpers to get code similar to Elm. That module says it supports both hyperscript and virtual-hyperscript, so I'm…
JuanCaicedo
  • 3,132
  • 2
  • 14
  • 36
0
votes
1 answer

hyperscript or hyperscript.org - "on click toggle .red on me" not working

One of the most basic examples in the simplest possible HTML file isn't working for me. I just copy/pasted the HTML in the docs. (I also checked the HTML in the docs site and it's the same) It's very hard to debug this. docs:…
0
votes
0 answers

Hyperscript not disabling select element when it changes

I'm trying to make HTMX and Hyperscript work together on a select element, what I expect: When user change select value it disables the select element and when it htmx finishes it removes the disabled attribute What happens: Everything works…
Tiago
  • 2,871
  • 4
  • 23
  • 39
0
votes
0 answers

hyperscript - how to make form steps

I am trying how to make form step wizard work using Hyperscript: https://hyperscript.org/ Can anyone point me in the right direction? This is my code:
webifo
  • 5
  • 2
1
2