Skip to Content
PureHTMLdocs
Transformers

exists

Check whether a selector matched any element in the DOM.

The exists transformer returns true if the selector matched one or more elements in the document, and false otherwise.

Element Exists

{ selector: div, transform: exists }

Element Does Not Exist

{ selector: span, transform: exists }

On this page