hide( )

Hides the element and sets its hidden property to true, using an effect if specified.


The hide() function hides the element and returns a Promise that is resolved when the effect is complete and the element's hidden property has been set to true.

Note: The hide() function doesn't remove the element from the DOM. To temporarily delete an element from the DOM and prevent it from detection by SEO crawlers, use the delete() function.

To learn about the behavior of a hidden element, see the hidden property.

You can optionally apply an effect when hiding the element by providing an effectName value. You can also customize the effect by providing the optional effectOptions object.


  • "arc"
  • "bounce"
  • "fade"
  • "flip"
  • "float"
  • "fly"
  • "fold"
  • "glide"
  • "puff"
  • "roll"
  • "slide"
  • "spin"
  • "turn"
  • "zoom"

You can also hide an element when the page loads by using the Properties and Events panel in the Editor.



This endpoint does not take any parameters

Response Object

Fulfilled - When the effect is complete and the element's hidden property has been set to true.

Returns an empty object.

Status/Error Codes

Related Content:

Was this helpful?

Hide an element with no effect

Copy Code
Hide an element with the "fade" effect

Copy Code
Hide an element with the "fade" effect and custom options

Copy Code
1let fadeOptions = {
2 "duration": 2000,
3 "delay": 1000
6$w("#myElement").hide("fade", fadeOptions);
Hide an element with an effect and log a message when the effect is done

Copy Code
2 .then( ( ) => {
3 console.log("Done with fade");
4} );
Toggle an element's hidden state

Copy Code
1if( $w("#myElement").hidden ) {
2 $w("#myElement").show();
4else {
5 $w("#myElement").hide();