If I understand correctly, you want to format the field with a decimal place. Try this code:
$("#valor").on("change", function()
{
this.value = Number(this.value.replace(",", ".")).toFixed(1).replace(".", ",");
});
Fiddle
Update
The closest I got with masked input was this:
$.mask.definitions['~']='([0-9] )?';
$("#valor").mask("~9,9", {placeholder: " "});
Fiddle
Based on in this answer .
But the mask got a * osta and I could not limit the number to 10.
Update 2
Making a mask in your hand, specific to your case, I came up with this code:
$("#valor").on("keyup", function(e)
{
var code = (e.keyCode || e.which);
// do nothing if it's an arrow key or backspace
if(code == 37 || code == 38 || code == 39 || code == 40 || code == 8) {
return;
}
var num = Number(this.value.replace(",", "."));
if (this.value.replace(",", "").length > 2) num = num * 100;
var value = (num <= 10 ? num : 10);
this.value = value.toFixed(1).replace(".", ",");
});
Fiddle