Which attribute restricts the phone field to the pattern 03 followed by 9 digits?

  1. pattern="03[0-9]9"
  2. maxlength="11"
  3. type="number"
  4. min="03"
Answer

A) pattern="03[0-9]9"

The pattern attribute validates the value with a regular expression.

Computer Science MCQ · More Lab: Mobile-Friendly Web Page MCQs · Practise