I like to have an input with maximum 3 characters. In Firefox everything works fine I can only write 3 numbers inside the input - but in safari you can write a lot of number
https://jsfiddle.net/zxqy609v/8/
function fixMaxlength(inputNumber) { var maxlength = $(inputNumber).attr("maxlength"); $(inputNumber).keyup(function (evt) { this.value = this.value.substring(0, maxlength); this.value = this.value.replace(/\D/g, ''); }); }