How to fix the caret position of a validated input?

  • 0
    There is an input with validation for money.

    1) Why can't the Del key delete a character if the cursor is before a space?
    2) Why does carriage save get confused? It should stay in the same place, but it gets confused and apparently due to gaps, but they seem to be preserved, since selectionStart is at the beginning of validation.
    JavaScript Lydia Knapp, Nov 25, 2020

  • 0 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!