Function isElement

  • Checks if value is likely a DOM element.

    Parameters

    • value: any

      The value to check.

    Returns value is Element

    Returns true if value is a DOM element, else false.

    5.6.0

    isElement(document.body)
    // => true

    isElement('<body>')
    // => false