hyperscript

Oct 20, 2023

https://hyperscript.org/

Hyperscript is a scripting language for doing front end web development. It is designed to make it very easy to respond to events and do simple DOM manipulation in code that is directly embedded on elements on a web page.

Example

<button _="on click toggle .red on me">
Click Me
</button>

The first thing to notice is that hyperscript is defined directly on the button, using the _ (underscore) attribute.

The next thing you will notice about hyperscript is its syntax, which is very different than most programming languages used today. Hyperscript is part of the xTalk family of scripting languages, which ultimately derive from HyperTalk. These languages all read more like english than the programming languages you are probably used to.

This unusual syntax has advantages, once you get over the initial shock:

From the authors of programming/javascript/HTMX

↑ up