title: Restrict input type="number" to its min or max if it is out of range
body: <p>I have the below code</p>
  
  <pre><code>&lt;form:input type="number" min="1" max="4" size="5" value="1" path="n" name='n' placeholder="&lt;5" style="height:25px;width:60px"&gt;&lt;/form:input&gt;
  </code></pre>
  
  <p>if a user enters a value in the textbox out of range then it should reset to its nearest min or max value, for example if user enters in textbox as less than 1 then it should get reset to 1, if he enters more than 4 then it should get reset to 4.</p>
  
  <p>Please advice if we have any other tag instead of using input tag to restrict</p>
  
  <p>There is a solution already which is not working for me</p>