static setInvalidState(element, message = 'Invalid') {
        if (message === '' || this.isNull(message)) this.throwError('Cannot set the invalid state with an empty message.');

        element.setCustomValidity(message);
    }
Set the invalid state for the given element.
A custom message can be passed as the second argument.
Note: This does not work with contenteditable elements

@param {HTMLElement|HTMLInputElement} element
@param {string|null} message
@throws Error