Try with below code:
$('#inputTxt').keydown(function (e) {
if (e.shiftKey || e.ctrlKey || e.altKey) {
e.preventDefault();
} else {
var key = e.keyCode;
if (!((key == 8) || (key == 46) || (key >= 35 && key <= 40) || (key >= 48 && key <= 57) || (key >= 96 && key <= 105))) {
e.preventDefault();
}
}
});
$("#inputTxt").on("change", function() {
var val = parseInt(this.value);
if(val > 100 || val < 50)
{
alert('Wrong range');
this.value ='';
}
})
Here inputTxt is ID of text box. You can change as per your need.