I've accomplished it with:
<input class="required" id="field" type="text" maxlength="3" pattern="([0-9]|[0-9]|[0-9])" name="cvv"/>
and then in JavaScript I prevented the letters:
$("#myField").keyup(function() {
$("#myField").val(this.value.match(/[0-9]*/));
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…