title: How to add multiple pattern in html input text
body: <p>How to use multiple pattern in html text input. So that,user can input 1 digit, 2 digit or 3 digit numbers.</p>
  
  <p>1:add '|' between each pattern</p>
  
  <pre><code>&lt;input type="text" name="id" id="id" maxlength="3" pattern="\d{1}|\d{2}|\d{3}" required&gt;
  </code></pre>
  
  <p>Result: Able to input one digit number only</p>
  
  <p>2: add '|' between each pattern and bracket for each pattern</p>
  
  <pre><code>&lt;input type="text" name="id" id="id" maxlength="3" pattern="(\d{1})|(\d{2})|(\d{3})" required&gt;
  </code></pre>
  
  <p>Result: Able to input one digit number only</p>