The set Command


  set <expression> to <expression>
  set <object literal> on <expression>


The set command allows you to set a value of a variable, property or the DOM. It is similar to the put command but reads more naturally for operations like setting variables.

It can also be used to set many properties at once using the set {...} on form.


<div _="on click set x to 'foo' then log x">
  Click Me!

<div _="on click set to 'red'">
  Click Me!

<button _="on click set { disabled: true, innerText: "Don't click me!" } on me">
  Click Me!