Determine if an element is visible in the dom.

Parameters:
NameTypeDescription
elemHTMLElement

The element to check for visibility.

Since
  • 1.0.0
Returns:

Whether or not the element is visible.

Type: 
boolean
Example
import { getNodes, visible } from "@gravityforms/utils";

function Example() {
  const target = getNodes( 'example' )[ 0 ];
  if ( visible( target ) ) {
      // do something
  }
}