I have a field to insert notes and I would like that if the value entered was greater than 10 or less than 0 the value was erased from the input.
I tried to do with the code below, but without success.
function verifica(v){
if (v > 10 || v < 0){
v = '';
}
}
<input type="number" onchange="verifica(this.value)">