• Determines whether the provided element is an instance of HTMLElement.

    This function checks if the provided element is not nullish (null or undefined) and if it is an instance of the HTMLElement class. It is used to validate if the element can be manipulated as an HTML element in the DOM.

    Parameters

    • element: unknown

      The element to be checked.

    Returns boolean

    true if the element is an HTMLElement instance, otherwise false.

    Example

    // Returns: true
    ix.api.is.isHTMLElement(document.getElementById('myElement'));

    // Returns: false
    ix.api.is.isHTMLElement("not-an-element");