• Modifies the read-only state of an input or textarea element.

    Parameters

    • element: HTMLInputElement | HTMLTextAreaElement

      The HTMLInputElement or HTMLTextAreaElement to modify.

    • readOnly: boolean

      The desired read-only state.

      • Set to true for read-only
      • Set to false to allow input/editing.

    Returns void

    Throws

    If the provided element is null or undefined.

    See

    MDN Documentation for the readonly attribute

    Example

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

    // Set the input element to read-only
    ix.api.dom.setReadOnly(inputElement, true);

    // Allow editing on the input element
    ix.api.dom.setReadOnly(inputElement, false);