This is from Disable writing in input type number HTML5, but it requires jQuery.
$("[type='number']").keypress(function (evt) {
evt.preventDefault();
});
Without jQuery code is: (input is an input field)
input.onkeypress=function(evt){
evt.preventDefault();
};