I am trying to restrict user for entering value from 0 - 25 in an HTML inputbox. I have found some code of jquery but its converting larger of smaller value to 25 and 0 respectively. Please amend the code: Code for HTML input box and jquery:
<input name='obtmarks[]' placeholder='' class='form-control obtmark' type='number' onchange='handleChange(this);' required='required' style='width: 120px;'>
<script>
function handleChange(input) {
if (input.value < 0) input.value = 0;
if (input.value > 25) input.value = 25;
}
</script>