The hide Command


hide [target] [with <hide-show-strategy>[: <argument>]] [when <expr>]


The hide command allows you to hide an element in the DOM using various strategies. The default strategy is display.

By default, the following strategies are available:

You can change the default hide/show strategy by setting _hyperscript.config.defaultHideShowStrategy

You can add new hide/show strategies by setting new values into the _hyperscript.config.hideShowStrategies object.


<div _="on click hide">Hide Me!</div>

<div _="on click hide with opacity">Hide Me With Opacity!</div>

<div _="on click hide #anotherDiv">Hide Another Div!</div>