• Retrieves the value of a specified attribute from a given HTML element.

    Parameters

    • element: HTMLElement

      The HTML element from which to retrieve the attribute value.

    • attributeName: string

      The name of the attribute whose value is to be retrieved.

    Returns null | string

    The value of the specified attribute. If the attribute does not exist, returns null.

    See

    MDN Documentation for Element.getAttribute()

    Example

    // Get an input element by its GUID
    const element = ix.api.dom.getHtml("<ELEMENT-GUID>");

    // Retrieve the 'type' attribute of the input element
    const type = ix.api.dom.getAttribute(element, "type");
    console.log(type); // Outputs the type of the input, e.g., "text"