title: Restrict user to put value in range in html input (type = number)
body: <p>How can I stop user from adding number greater than max value and smaller then min value in html input(type = number)</p>
  
  <pre><code>&lt;input id="ageRange" type="number" min=20 max= 50 maxlength=2&gt;&lt;/input&gt;
  </code></pre>
  
  <p>I tried one javascript code, but it makes change after we add the value then it changes the value. Is there any way that I can stop user to put value in range or just there is no flickering in the input cell while we change value programatically?</p>