set CommandThe set command assigns a value to a variable, property, or DOM element. It's similar to put but reads more naturally for assignment operations like set x to 10.
You can also set many properties at once using the set {...} on form.
When setting a symbol like x, hyperscript follows these rules:
x exists in the current local scope, set the locally scoped valuex exists in the current element-local scope, set the element-local scoped valuex with the valueTo set a global variable, you must use the global modifier (unless the symbol starts with $):
set global globalVar to 10
<div _="on click set x to 'foo' then log x">
Click Me!
</div>
<div _="on click set my.style.color to 'red'">
Click Me!
</div>
<button _="on click set { disabled: true, innerText: "Don't click me!" } on me">
Click Me!
</button>
set <expression> to <expression>
set <object-literal> on <expression>