Hide

by @pixiebrix

Hide or remove one or more elements on a page


How to Use

The Hide Element brick can be used to hide (and optionally remove from the DOM) certain elements of the page.

After adding the Hide Element brick, use the selector input button or jQuery in the ‘selector’ input field to define which element to show.

This brick pairs well with the Show Element brick.

Use Cases

This brick is useful when:

  • You want to hide some HTML element from the page
  • You want to remove some HTML element from the page

The HTML can be from the original page, or maybe HTML that you’ve added to the page dynamically through another brick.

How to use it

To use this brick you can use a selector or pass it a variable whose value is a selector

  • Selector:

Additionally you can specify a mode:

  • Mode:
    • Remove: This removes the element from the DOM
    • Hide: This hides the element by applying a CSS style to it

Example

Video: Loom


Inputs

Name Required Type Description
mode string
selector string
isRootAware boolean Whether the brick should run in the context of the target element, or document

Outputs

Name Required Type Description
No outputs for this brick defined.

@pixiebrix/hide

Version

1.7.16

Created

Aug. 17, 2021

Updated

May 26, 2022