How to do phone number validation using pure JavaSript (BY) + 375YYXXXXXXX?

  • 0
    How to check a phone number for validity? Those. we issue the message "number is correct" or "not correct" Number format + 375YYXXXXXXX. Brackets and dashes can be ignored.
    JavaScript Anonymous, Mar 3, 2019

  • 2 Answers
  • 0

  • 0
    if( /^\+375\d{9}$/.test(phoneNumber) ) alert('Номер верный')
    else alert('Номер не верный')

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