addInputError (input, text) {
    /* Get the parent element. Should most likely be a <div class="input-field" ... />. */
    const parent = input.parentNode

    if (!parent) return

    /* Remove any previous error. */
    this.removeInputError(input)

    /* Append an error message div. */
    const el = document.createElement('div')
    el.classList.add('error-text', 'red-text')
    el.textContent = text
    parent.appendChild(el)
  }
Adds an error message to the specified input element.

@param {HTMLElement} input The input element that caused the error.
@param {string} text The error message.