How to block input when typing a specific word?

  • 0
    Good evening, I was trying to find a ready-made method, but I could not find anything suitable, or there is, but jQuery is used.
    In general, there is a problem, when the user enters a specific word (some 1 or from the list), then the input becomes blocked using disabled.
    I myself tried to do something, but my knowledge is not enough, I need to do it in pure Js. Help me please.
    JavaScript Ryan Chan, Oct 9, 2019

  • 2 Answers
  • 0
    Nolan Adkins

  • 0
    Well, you need to put an event handler - of the onChange type; in this handler, check what you want and do what you need. Actually, read what handlers you can hang on the input - and choose the most suitable one.
    Natalie Gilbert

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