@nevware21/ts-utils
    Preparing search index...

    Function isElementLike

    • Checks if a value has the basic properties of a DOM Element without requiring it to be an actual Element instance. This is useful for identifying objects that have element-like properties but aren't actual DOM Elements.

      Parameters

      • value: any

        The value to check

      Returns boolean

      True if the value has the basic properties of a DOM Element, false otherwise

      // Real DOM element
      isElementLike(document.createElement('div')); // true

      // Object that has element-like properties
      isElementLike({
      nodeType: 1,
      nodeName: 'DIV'
      }); // true

      isElementLike(document); // false
      isElementLike({}); // false
      isElementLike(null); // false
      isElementLike(undefined); // false