How to prevent inserting value that is greater than to max in number field in html
<p>I am using number field in html5,</p>

<p>here is my code,</p>

<pre><code>&lt;input type="number" class="edit-items" /&gt;
</code></pre>

<p>i set the max of this number field using javascript.</p>

<pre><code>element.max = quantity;
element.min = 0;
element.step = 1;
</code></pre>

<p>If i am using the arrow-up in the number field. Greater value than the max is not possible. But when I tried to insert in the field, greater value than the max is possible.  </p>

<p>I would like to prevent it. How?</p>