I am new in javascript and don't know what to in this case please provide me solution
<input type="text" name="technical" maxlength="3" id="numa" onKeyUp="this.value = minmax(this.value, 0, 5)" class="input-text persent managementskill" value="<?=set_value('technical',$this->input->post('technical'))?>" />
<script type="text/javascript">
function minmax(value, min, max)
{
if(parseInt(value) < min || isNaN(value))
return 0;
else if(parseInt(value) > max)
return 5;
else return value;
}
</script>
This is my code is working fine for the first entry of input it will not except after 5 but I want if we enter 5.1 then it automatically converts that num to 5.0 want this to except only 0.0 to 5.0 what to do in my function please help