/

Element state

Element state is a concept which describes the main properties of the masked element at the certain period of time.

It is an object which implements the following interface:

    
      interface ElementState {
  // the value of a masked <input> or <textarea>
  readonly value: string;
  readonly selection: readonly [
    // The 0-based index of the first selected character
    from: number,
    // Index of the character after the last selected character
    to: number,
  ];
}
    

This concept is actively used throughout Maskito libraries, and you can find its usage in the following topics: